8000 Create Development Utilities MCP Server Template with SSE Support · Issue #597 · modelcontextprotocol/typescript-sdk · GitHub
[go: up one dir, main page]

Skip to content
Create Development Utilities MCP Server Template with SSE Support #597
Closed
@FrancisVarga

Description

@FrancisVarga

🎯 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 analysis
    • read_file: File content reading
    • git_status: Git repository status
    • format_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 prompts
    • debug_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]
Loading

📁 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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0