home / mcp / mcp starter mcp server
Provides an MCP server that connects AI models to tools, data sources, and prompts via stdio or HTTP transports.
Configuration
View docs{
"mcpServers": {
"chry8822-workout-mcp": {
"url": "http://localhost:3000/mcp",
"headers": {
"PORT": "3000",
"CORS_ORIGIN": "*",
"STARTER_TRANSPORT": "http"
}
}
}
}You can build an MCP server in TypeScript that connects AI models to tools, data sources, and prompts through a consistent protocol. This server starter gives you a production-ready structure with auto-loading, strong typing, and ready-to-run transports so you can focus on building capabilities for your applications.
You interact with your MCP server by running it in one of two transport modes. In stdio mode you launch locally and connect through the process standard I/O. In HTTP mode you expose a web endpoint that streams server-sent events and accepts JSON-RPC requests. Start by building, then run the appropriate transport, and finally test using an MCP client to list tools, resources, and prompts.
Prerequisites you need before installing include Node.js version 20.11.0 or higher and a package manager (npm or yarn). You will also want a basic understanding of TypeScript and MCP concepts.
Concrete steps to set up the server locally and prepare for development:
1) Clone the starter project or obtain the template you want to customize.
2) Install dependencies
3) Build the project
4) Run the server using the transport you prefer (stdio or http)
{
"type": "stdio",
"name": "starter_stdio",
"command": "npm",
"args": ["run", "serve:stdio"]
}{
"type": "stdio",
"name": "starter_stdio_build",
"command": "node",
"args": ["build/index.js"]
}{
"type": "http",
"name": "starter_http",
"url": "http://localhost:3000/mcp",
"args": []
}Configure behavior with environment variables. The following are shown as part of the server setup: STARTER_TRANSPORT, PORT, and CORS_ORIGIN.
{
"servers": {
"starter-stdio": {
"type": "stdio",
"command": "node",
"args": ["./build/index.js"]
},
"starter-http": {
"type": "http",
"url": "http://localhost:3000/mcp"
}
}
}Docker support exists for straightforward deployment and development with hot reloading in a dev profile.
For dev work, you can mount your source and enable live reload, then access the server on the development port.
The server auto-loads modules placed in the appropriate directories (tools, resources, prompts). This makes adding new capabilities fast and zero-config.
You can test interactively with the MCP Inspector. Build the server, then use the inspector to connect and exercise tools, resources, and prompts.
Create a new file under the tools directory. Implement the tool and register it with the MCP server. Tools become callable actions from the AI client.
Maintain strict typing with TypeScript, validate inputs with a schema (like zod), and ensure proper error handling and clear messages for clients.
Common issues include missing modules after build, incorrect paths in configuration, and modules not loading due to export mismatches. Run type checks and ensure the server is built before starting.
Once you have a working server, you can expand with more tools, resources, and prompts, all auto-discovered by the loader. Iterate by building, testing with the inspector, and refining your MCP ecosystem.
Example echo tool that returns the provided input to demonstrate tool invocation and response flow