Skip to main content
Glama

MCP Server Template

MCP Server Template 🛠️

A starter template for building your own Model Context Protocol (MCP) server. This template provides the basic structure and setup needed to create custom MCPs that can be used with Cursor or Claude Desktop.

Features

  • Basic MCP server setup with TypeScript
  • Sample tool implementation
  • Ready-to-use project structure
  • Built with @modelcontextprotocol/sdk

Project Structure

mcp-server-template/ ├── index.ts # Main server implementation ├── package.json # Project dependencies ├── tsconfig.json # TypeScript configuration └── build/ # Compiled JavaScript output

Getting Started

  1. Clone this template:
git clone [your-repo-url] my-mcp-server cd my-mcp-server
  1. Install dependencies:
pnpm install
  1. Build the project:
pnpm run build

This will generate the /build/index.js file - your compiled MCP server script.

Using with Cursor

  1. Go to Cursor Settings -> MCP -> Add new MCP server
  2. Configure your MCP:
    • Name: [choose your own name]
    • Type: command
    • Command: node ABSOLUTE_PATH_TO_MCP_SERVER/build/index.js

Using with Claude Desktop

Add the following MCP config to your Claude Desktop configuration:

{ "mcpServers": { "your-mcp-name": { "command": "node", "args": ["ABSOLUTE_PATH_TO_MCP_SERVER/build/index.js"] } } }

Development

The template includes a sample tool implementation in index.ts. To create your own MCP:

  1. Modify the server configuration in index.ts:
const server = new McpServer({ name: "your-mcp-name", version: "0.0.1", });
  1. Define your custom tools using the server.tool() method:
server.tool( "your-tool-name", "Your tool description", { // Define your tool's parameters using Zod schema parameter: z.string().describe("Parameter description"), }, async ({ parameter }) => { // Implement your tool's logic here return { content: [ { type: "text", text: "Your tool's response", }, ], }; } );
  1. Build and test your implementation:
npm run build

Contributing

Feel free to submit issues and enhancement requests!

License

MIT

Install Server
A
security – no known vulnerabilities
F
license - not found
A
quality - confirmed to work

local-only server

The server can only run on the client's local machine because it depends on local resources.

A starter template for building Model Context Protocol servers that can be integrated with Cursor or Claude Desktop, allowing developers to create custom tools and extensions for AI assistants.

  1. Features
    1. Project Structure
      1. Getting Started
        1. Using with Cursor
          1. Using with Claude Desktop
            1. Development
              1. Contributing
                1. License

                  Related MCP Servers

                  • -
                    security
                    F
                    license
                    -
                    quality
                    A starter template for building Model Context Protocol (MCP) servers, enabling developers to create and add custom tools that can be integrated with Claude Desktop.
                    Last updated -
                    2
                    TypeScript
                    • Apple
                  • -
                    security
                    F
                    license
                    -
                    quality
                    A modular, extensible Model Context Protocol server framework designed for Claude Desktop that uses convention-based automatic module discovery to easily extend AI application functionality without modifying core code.
                    Last updated -
                    3
                    Python
                  • A
                    security
                    A
                    license
                    A
                    quality
                    A foundation for building custom local Model Context Protocol (MCP) servers that provide tools accessible to AI assistants like Cursor or Claude Desktop.
                    Last updated -
                    1
                    23
                    TypeScript
                    MIT License

                  View all related MCP servers

                  MCP directory API

                  We provide all the information about MCP servers via our MCP API.

                  curl -X GET 'https://glama.ai/api/mcp/v1/servers/hypermodel-labs/mcp-server-template'

                  If you have feedback or need assistance with the MCP directory API, please join our Discord server