MCP - Model Context Protocol Server
A modular MCP (Model Context Protocol) HTTP server that enables LLM clients to interact with multiple services through a unified API.
Quick Start```bash
1. Clone and install
git clone <repository-url>
cd mcp-poc
npm install
2. Build and run
npm run dev
Or just run (if already built)
npm start
Server will start on http://localhost:3000
## Usage
### Check Server Health```bash
curl http://localhost:3000/health
``````json
{
"status": "healthy",
"server": "mcp-server",
"transport": "http-sse",
"features": ["sms"],
"tools": 1
}
Connect from Your Application```typescript
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { SSEClientTransport } from "@modelcontextprotocol/sdk/client/sse.js";
// Connect to MCP server
const client = new Client(
{ name: "my-app", version: "1.0.0" },
{ capabilities: {} }
);
await client.connect(
new SSEClientTransport(new URL("http://localhost:3000/sse"))
);
// List available tools
const { tools } = await client.listTools();
console.log(tools); // [{ name: "send_employee_notification", ... }]
// Call a tool
const result = await client.callTool({
name: "send_employee_notification",
arguments: {
customerName: "Maria Schmidt",
employeeName: "John",
employeeMobileNumber: "+491234567890"
}
});
# Contribution
## Adding New Features
The modular architecture makes it easy to add new features:
1. **Create feature file**: `src/servers/main/features/[name]/feature.ts````typescript
import type { MCPFeature } from "../registry.js";
export const myFeature: MCPFeature = {
name: "my-feature",
tools: [
{
name: "my_tool",
description: "What this tool does",
inputSchema: { /* JSON Schema */ }
}
],
toolHandlers: [
{
name: "my_tool",
handler: async (args) => {
// Your implementation
return { content: [{ type: "text", text: "Result" }] };
}
}
],
initialize: async () => {
// Setup code
}
};
- Register in server: `src/servers/main/index.ts````typescript
import { myFeature } from "./features/my-feature/feature.js";
function registerFeatures() {
featureRegistry.register(smsFeature);
featureRegistry.register(myFeature); // Add here
}
3. **Rebuild and restart**:```bash
npm run dev
Your new tools are now available via the MCP server!
Documentation
📚 Full Documentation - Complete guides and references
- Architecture - System design and patterns
- HTTP Transport - Deployment and client integration
- Adding Providers - Extend SMS with new providers
- Adding Features - Add new tool categories
Development```bash
Start development env
npm run dev
Watch mode
npm run dev:watch
Build
npm run build
Run with debug logging
DEBUG=true npm run dev
```
License
MIT - See LICENSE file for details
