Development guidelines for building and maintaining a Chess MCP server with AI capabilities, including transposition tables, iterative deepening, and proper testing practices.
This skill provides comprehensive development guidelines for building and maintaining a Chess MCP (Model Context Protocol) server with advanced AI capabilities.
This skill guides you through developing a chess engine with MCP integration, featuring:
1. **TypeScript First**
- Use TypeScript for all source files
- Define proper types and interfaces for all functions
- Use meaningful variable and function names
- Include JSDoc comments for complex functions
2. **Execution Model**
- Use `tsx` for direct execution (no build step needed)
- Run with: `npx tsx src/index.ts`
- No JavaScript wrapper files needed
3. **Architecture Principles**
- Follow modular design patterns
- Maintain clean separation of concerns
- Implement proper error handling with logging
- Use consistent formatting (Prettier recommended)
1. **Transposition Tables**
- Implement with 1M entry limit
- Use LRU (Least Recently Used) eviction strategy
- Provides 2-5x search speed improvement
2. **Search Algorithms**
- Implement alpha-beta pruning with move ordering
- Use iterative deepening for progressive depth search
- Include time management (5-second maximum for AI moves)
- Maximum search depth: 8 plies for advanced levels
3. **Memory Management**
- Implement LRU eviction for caches
- Set and enforce size limits
- Ensure proper cleanup and no memory leaks
1. **Test Coverage**
- All tests must pass before committing
- Use Jest with ES modules configuration
- Cover both chess engine and AI functionality
- Include performance tests and edge cases
2. **Test Categories**
- **Unit Tests**: Cover all core functionality
- **Integration Tests**: Verify MCP server functionality
- **Performance Tests**: Validate AI response times
- **Edge Cases**: Test checkmate, stalemate, special moves
3. **Test Commands**
```bash
# Run all tests
npm test
# Run specific test
npm test -- --testPathPattern="chess-engine"
```
1. **Benchmarks**
- Search speed: 2-5x improvement through transposition tables
- Memory usage: Controlled and optimized
- Move quality: Enhanced through iterative deepening
- Stability: No crashes or infinite loops
2. **Limits**
- Maximum search depth: 8 plies
- Time limit per move: 5 seconds
- Transposition table: 1M entries
- Memory: Controlled with size limits
1. **Configuration**
- Use standard MCP protocol implementation
- Implement proper error handling and logging
- Configure in MCP client:
```json
{
"mcpServers": {
"chess": {
"name": "Chess MCP",
"type": "stdio",
"command": "npx",
"args": ["tsx", "/path/to/Chess-MCP/src/index.ts"]
}
}
}
```
2. **Execution**
```bash
# Start MCP server
npx tsx src/index.ts
# Development mode
npm run dev
```
1. **Commit Practices**
- Use descriptive commit messages
- Test before committing
- Keep commits focused and atomic
- Update documentation with significant changes
2. **Code Quality Checks**
- All functions have proper TypeScript types
- Tests pass before commit
- Documentation is current
- Error handling is implemented
1. **Maintain Documentation**
- Keep README.md updated with current features
- Include usage examples
- Document architecture and design decisions
- Update performance benchmarks
2. **Code Documentation**
- JSDoc comments for complex functions
- Type annotations for all functions
- Inline comments for non-obvious logic
```bash
git clone <repository>
cd Chess-MCP
npm install
npm test
npx tsx src/index.ts
```
1. Write tests first (TDD approach)
2. Implement feature with proper TypeScript types
3. Ensure all tests pass
4. Update documentation
5. Commit with descriptive message
```bash
npm test -- --testPathPattern="performance"
```
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/chess-mcp-server-development/raw