Closed
Description
🎯 Objective
Create a fully functional MCP server template for development utilities that demonstrates:
- Tools: Code analysis, file operations, git status
- Resources: Project information, file content access
- Prompts: Code review assistance, debugging help
- SSE Transport: Server-Sent Events communication
- Docker: Containerized deployment
📋 Requirements
Core Features
- SSE Transport Layer: Implement streamable HTTP transport with session management
- Essential Tools:
analyze_code
: Basic static code analysisread_file
: File content readinggit_status
: Git repository statusformat_code
: Code formatting utility
- Basic Resources:
project://info
: Project metadata (package.json, structure)file://content
: File content access
- Development Prompts:
code_review
: Generate code review promptsdebug_help
: Debugging assistance prompts
Technical Implementation
- TypeScript: Full TypeScript implementation using MCP SDK
- Express.js: Web server with SSE endpoints
- Session Management: Handle multiple client connections
- Docker: Multi-stage Dockerfile for production deployment
- Error Handling: Proper error responses and logging
🏗️ Architecture
graph TB
subgraph "Docker Container"
A[Express Server] --> B[SSE Transport]
B --> C[MCP Protocol Handler]
C --> D[Tools Registry]
C --> E[Resources Registry]
C --> F[Prompts Registry]
end
G[MCP Client] -.->|SSE Connection| A
D --> H[Code Analysis]
D --> I[File Operations]
D --> J[Git Integration]
📁 Project Structure
src/
├── server.ts # Main Express server with SSE
├── transport.ts # SSE transport implementation
├── tools.ts # Development tools implementation
├── resources.ts # Project resources
├── prompts.ts # Development prompts
└── types.ts # TypeScript definitions
Dockerfile # Multi-stage container build
package.json # Dependencies and scripts
README.md # Usage instructions
🛠️ Key Dependencies
{
"dependencies": {
"@modelcontextprotocol/sdk": "latest",
"express": "^4.18.0",
"cors": "^2.8.5",
"helmet": "^7.0.0",
"winston": "^3.8.0"
},
"devDependencies": {
"typescript": "^5.0.0",
"@types/express": "^4.17.0",
"@types/node": "^20.0.0"
}
}
🐳 Docker Configuration
- Multi-stage build for optimized production image
- Node.js Alpine base for minimal size
- Health check endpoints
- Environment variables for configuration
- Volume mounts for project access
🚀 Usage Example
# Build and run with Docker
docker build -t mcp-dev-server .
docker run -p 3000:3000 -v $(pwd):/workspace mcp-dev-server
# Connect MCP client to http://localhost:3000/mcp
✅ Acceptance Criteria
- Server starts successfully in Docker container
- SSE transport handles client connections
- All tools respond correctly to MCP requests
- Resources provide accurate project information
- Prompts generate helpful development assistance
- Error handling works for invalid requests
- Session management maintains state across requests
- Docker container builds without errors
- README provides clear setup instructions
🎯 Success Metrics
- Functional: All MCP protocol features working
- Performance: Sub-100ms response times for basic operations
- Reliability: Handles connection drops gracefully
- Usability: Clear documentation and examples
- Deployment: One-command Docker deployment
Priority: High
Type: Feature
Effort: Medium (POC Template)
Labels: mcp-server
, typescript
, sse
, docker
, template
Metadata
Metadata
Assignees
Labels
No labels