mcp-ts-core — Claude Code MCP server: features and setup
A TypeScript framework for building MCP servers, with foundations for tools, access control, storage, logging, and transports. Use it to connect an API or workflow to an AI agent.
claude mcp add --env MCP_LOG_LEVEL=<MCP_LOG_LEVEL> --env MCP_TRANSPORT_TYPE=<MCP_TRANSPORT_TYPE> --env MCP_HTTP_HOST=<MCP_HTTP_HOST> --env MCP_HTTP_PORT=<MCP_HTTP_PORT> --env MCP_HTTP_ENDPOINT_PATH=<MCP_HTTP_ENDPOINT_PATH> --transport stdio mcp-ts-core -- npx -y @cyanheads/mcp-ts-coreWhat mcp-ts-core does
mcp-ts-core provides the server foundation while your project supplies its domain logic. Define typed tools, resources, prompts, and MCP Apps; the framework also covers access control, tenant-scoped storage, and logging. Servers can use stdio or HTTP on Bun and Node.js, with a separate entry point for Cloudflare Workers.
Start a project with bunx @cyanheads/mcp-ts-core init my-mcp-server. The scaffold contains source files, build and test configuration, agent instruction files, and Agent Skills for tool design, testing, security review, and releases. To add the server in Claude Code, run claude mcp add mcp-ts-core -- npx -y @cyanheads/mcp-ts-core. Bun projects require Bun; the Node.js option requires Node.js 24 or newer. DuckDB, Supabase, and the OpenTelemetry SDK are optional peer dependencies, so install them when using those integrations.
What it helps with
- scaffold an MCP server around an API
- define typed inputs and outputs for a tool
- expose resources and prompts to an agent
- provide recovery guidance for declared errors
- test tool definitions and catch contract issues
Example prompts for the agent
- Create an MCP server for our inventory API with a product search tool.
- Add a stock-checking tool to this MCP server and define its input and output schemas.
- Review the tool definitions for errors and set up server tests.
How to install mcp-ts-core
Platform CLI
claude mcp add --env MCP_LOG_LEVEL=<MCP_LOG_LEVEL> --env MCP_TRANSPORT_TYPE=<MCP_TRANSPORT_TYPE> --env MCP_HTTP_HOST=<MCP_HTTP_HOST> --env MCP_HTTP_PORT=<MCP_HTTP_PORT> --env MCP_HTTP_ENDPOINT_PATH=<MCP_HTTP_ENDPOINT_PATH> --transport stdio mcp-ts-core -- npx -y @cyanheads/mcp-ts-coreReplace <…> with your own values. 1 more environment variable is in the server README
Platform CLI
codex mcp add mcp-ts-core --env MCP_LOG_LEVEL=<MCP_LOG_LEVEL> --env MCP_TRANSPORT_TYPE=<MCP_TRANSPORT_TYPE> --env MCP_HTTP_HOST=<MCP_HTTP_HOST> --env MCP_HTTP_PORT=<MCP_HTTP_PORT> --env MCP_HTTP_ENDPOINT_PATH=<MCP_HTTP_ENDPOINT_PATH> -- npx -y @cyanheads/mcp-ts-coreReplace <…> with your own values. 1 more environment variable is in the server README
Config file
{
"mcpServers": {
"mcp-ts-core": {
"command": "npx",
"args": [
"-y",
"@cyanheads/mcp-ts-core"
],
"env": {
"MCP_LOG_LEVEL": "<MCP_LOG_LEVEL>",
"MCP_TRANSPORT_TYPE": "<MCP_TRANSPORT_TYPE>",
"MCP_HTTP_HOST": "<MCP_HTTP_HOST>",
"MCP_HTTP_PORT": "<MCP_HTTP_PORT>",
"MCP_HTTP_ENDPOINT_PATH": "<MCP_HTTP_ENDPOINT_PATH>"
}
}
}
}Replace <…> with your own values. 1 more environment variable is in the server README
Config file
{
"servers": {
"mcp-ts-core": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@cyanheads/mcp-ts-core"
],
"env": {
"MCP_LOG_LEVEL": "<MCP_LOG_LEVEL>",
"MCP_TRANSPORT_TYPE": "<MCP_TRANSPORT_TYPE>",
"MCP_HTTP_HOST": "<MCP_HTTP_HOST>",
"MCP_HTTP_PORT": "<MCP_HTTP_PORT>",
"MCP_HTTP_ENDPOINT_PATH": "<MCP_HTTP_ENDPOINT_PATH>"
}
}
}
}Replace <…> with your own values. 1 more environment variable is in the server README
Platform CLI
gemini mcp add -e MCP_LOG_LEVEL=<MCP_LOG_LEVEL> -e MCP_TRANSPORT_TYPE=<MCP_TRANSPORT_TYPE> -e MCP_HTTP_HOST=<MCP_HTTP_HOST> -e MCP_HTTP_PORT=<MCP_HTTP_PORT> -e MCP_HTTP_ENDPOINT_PATH=<MCP_HTTP_ENDPOINT_PATH> mcp-ts-core npx -y @cyanheads/mcp-ts-coreReplace <…> with your own values. 1 more environment variable is in the server README
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about mcp-ts-core
How do I install mcp-ts-core in Claude Code?
Run claude mcp add mcp-ts-core -- npx -y @cyanheads/mcp-ts-core. This registers the server under the name mcp-ts-core.
What does mcp-ts-core do?
It is a TypeScript framework for building MCP servers. It provides typed definitions for tools, resources, and prompts, alongside access control, storage, logging, and stdio or HTTP transports.
What runtimes can run an mcp-ts-core server?
The framework supports Bun and Node.js 24 or newer, plus Cloudflare Workers. DuckDB, Supabase, and the OpenTelemetry SDK are separate dependencies for projects that use those integrations.