MCP protocol primitives for server authors
- Dominant language
- TypeScript
- Stars
- 3.6k
- Forks
- 681
- PR merge metrics
- No merged PRs in 30d
Description
Deno's standard library already includes first-class support for web standards like Fetch, WebSocket, and Server-Sent Events. MCP (Model Context Protocol) is rapidly becoming a standard for AI tool integration, and Deno is well-positioned to provide built-in primitives for it.
Currently, MCP server authors using Deno must either:
1. Use the npm package \@modelcontextprotocol/sdk\ (which is Node.js-focused)
2. Implement the JSON-RPC protocol manually over std/http
A Deno-native MCP module in the standard library would:
1. Provide proper TypeScript types for the MCP protocol without npm dependency
2. Handle JSON-RPC over stdin/stdout, SSE, and WebSocket transports natively
3. Integrate with Deno's permission model for tool safety
4. Be audit-free since it's part of the runtime
This would make Deno the most natural platform for building MCP servers, especially since:
- MCP servers are often single-file scripts (perfect for Deno)
- Deno's security model (--allow-read, --allow-net) maps cleanly to MCP's tool permission model
- Deno's TypeScript support means zero config for MCP server authors
A std/mcp module could expose:
\\\ ypescript
import { McpServer } from 'jsr:@std/mcp';
const server = new McpServer({
name: 'my-tool',
tools: {
greet: {
description: 'Greet someone',
inputSchema: { ... },
handler: (args) => \Hello \\
}
}
});
// Auto-detects transport (stdio vs HTTP)
server.listen();
\\\
This would be a significant DX improvement over the current npm-based approach.
Contributor guide
Assessment
This issue has not been assessed yet.