
null-shot/mcp
Developer toolsЭта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал
A template repository for bootstrapping MCPs (Model Context Protocol) for the xava-labs/typescript-agent-framework.
Обзор
A template repository for bootstrapping MCPs (Model Context Protocol) for the xava-labs/typescript-agent-framework. 1. Click the "Use this template" button at the top of this repository 2. Clone your new repository You can create a new project based on this template using wrangler: Once you have completed one of the above methods, then run the following commands in your terminal to get started: The above will boostrap a serverless cloudflare compatible MCP Server with the following urls: * /ws - Websocket connection endpoint * /sse - SSE connection endpoint - : Includes official WebSocket client for real-time bidirectional communication - : Includes Server-Sent Events client for server-to-client streaming - : Debug and monitor your MCP during development - : Built on Cloudflare Workers for edge computing capabilities - : Websocket and SSE testing tools to do full integration testing with local miniflare services (D1/KV/etc) for ease of testing features without mocking.
README
Показан фрагмент оригинального README. Открыть оригинал.
Xava Labs Typescript MCP Template
A template repository for bootstrapping MCPs (Model Context Protocol) for the xava-labs/typescript-agent-framework.
Getting Started
Setup the repository
Option A: Use this template*
- Click the “Use this template” button at the top of this repository
- Clone your new repository
Option b: Use wrangler init
You can create a new project based on this template using wrangler:
npx wrangler init my-mcp-project --git https://github.com/xava-labs/mcp-template
cd my-mcp-project
Once you have completed one of the above methods, then run the following commands in your terminal to get started:
yarn install
yarn dev
The above will boostrap a serverless cloudflare compatible MCP Server with the following urls:
- /ws - Websocket connection endpoint
- /sse - SSE connection endpoint
Features
- WebSocket Client Support: Includes official WebSocket client for real-time bidirectional communication
- SSE Client Support: Includes Server-Sent Events client for server-to-client streaming
- MCP Inspector: Debug and monitor your MCP during development
- Cloudflare Workers Integration: Built on Cloudflare Workers for edge computing capabilities
- Integration Testing Suite: Websocket and SSE testing tools to do full integration testing with local miniflare services (D1/KV/etc) for ease of testing features without mocking.
Available Scripts
yarn dev: Runs both the MCP Inspector (port 6274) and Cloudflare Worker (port 8787) concurrentlyyarn start: Runs only the Cloudflare Worker (port 8787)yarn test: Runs tests with Vitestyarn deploy: Deploys your MCP to Cloudflare Workersyarn cf-typegen: Generates TypeScript types for Cloudflare Workers (run this everytime you add new changes to wrangler.jsonc)
Development
This template implements an MCP server using Durable Objects for stateful connections. The base project structure offers two main approaches for extending functionality:
McpHonoServerDO Implementation
By default, the template uses McpHonoServerDO which combines the MCP server with Hono, a fast and lightweight web framework. This provides a clean routing system and middleware capabilities.
Extending with Tools, Resources, and Prompts
The main server implementation is in src/server.ts and extends McpHonoServerDO:
export class ExampleMcpServer extends McpHonoServerDO {
// Required abstract method implementation
getImplementation(): Implementation {
return {
name: 'ExampleMcpServer',
version: '1.0.0',
};
}
Установка
npx wrangler init my-mcp-project --git https://github.com/xava-labs/mcp-template