Skip to main content
Glama
README.md
# 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.

<a href="https://glama.ai/mcp/servers/vnt96edg3a">
  <img width="380" height="200" src="https://glama.ai/mcp/servers/vnt96edg3a/badge" alt="Server Template MCP server" />
</a>

## Features

- Basic MCP server setup with TypeScript
- Sample tool implementation
- Ready-to-use project structure
- Built with [@modelcontextprotocol/sdk](https://docs.anthropic.com/en/docs/agents-and-tools/mcp)

## 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:
```bash
git clone [your-repo-url] my-mcp-server
cd my-mcp-server
```

2. Install dependencies:
```bash
pnpm install
```

3. Build the project:
```bash
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:

```json
{
  "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`:
```typescript
const server = new McpServer({
  name: "your-mcp-name",
  version: "0.0.1",
});
```

2. Define your custom tools using the `server.tool()` method:
```typescript
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",
        },
      ],
    };
  }
);
```

3. Build and test your implementation:
```bash
npm run build
```

## Contributing

Feel free to submit issues and enhancement requests!

## License

MIT

TDQS

C2.6/5.0

Scored across 1 tool

Disambiguation5/5

With only one tool, there is no possibility of ambiguity or overlap between tools, as there are no other tools to confuse it with. The single tool's purpose is clearly distinct by default in this minimal set.

Naming Consistency5/5

The tool name 'sample-tool' uses a consistent hyphenated noun pattern, and with only one tool, there is no inconsistency to evaluate. The naming is straightforward and follows a simple convention.

Tool Count2/5

A single tool is too few for most practical server purposes, as it severely limits functionality and scope. This feels thin and inadequate for handling any meaningful domain or workflow beyond basic demonstration.

Completeness1/5

The server is severely incomplete, with only a sample tool that lacks any clear domain or operational coverage. There are obvious gaps, as no CRUD, lifecycle, or specific functionality is provided, making it impossible for agents to perform useful tasks.

Maintenance

ActivityInactive
ResponsivenessNo issues