home / mcp / mcp starter mcp server

MCP Starter MCP Server

Provides an MCP server that connects AI models to tools, data sources, and prompts via stdio or HTTP transports.

Installation
Add the following to your MCP client configuration file.

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.

How to use

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.

How to install

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)

Transport modes and startup commands

{
  "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": []
}

Environment variables

Configure behavior with environment variables. The following are shown as part of the server setup: STARTER_TRANSPORT, PORT, and CORS_ORIGIN.

Configuration examples

{
  "servers": {
    "starter-stdio": {
      "type": "stdio",
      "command": "node",
      "args": ["./build/index.js"]
    },
    "starter-http": {
      "type": "http",
      "url": "http://localhost:3000/mcp"
    }
  }
}

Docker and development notes

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.

Project structure and auto-loading

The server auto-loads modules placed in the appropriate directories (tools, resources, prompts). This makes adding new capabilities fast and zero-config.

Testing and inspector

You can test interactively with the MCP Inspector. Build the server, then use the inspector to connect and exercise tools, resources, and prompts.

Adding a new tool

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.

Security and best practices

Maintain strict typing with TypeScript, validate inputs with a schema (like zod), and ensure proper error handling and clear messages for clients.

Troubleshooting

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.

Notes and next steps

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.

Available tools

echo

Example echo tool that returns the provided input to demonstrate tool invocation and response flow