Skip to main content
Glama
MCP Server Starter

MCP Server Starter

by dao77777
README.md
# MCP Server Starter

A minimal **Model Context Protocol (MCP)** server with 3 tools, Zod input schemas, tests and Docker.

This is the kind of server an AI coding agent can call to work with an issue tracker: list issues, read one issue, and add a comment.

## Tools

| Tool | Input | What it does |
| --- | --- | --- |
| `list_issues` | `status?: open \| closed \| all`, `limit?: 1..50` | List issues |
| `get_issue` | `id: number` | Get one issue with comments |
| `add_comment` | `id`, `body`, `author?` | Add a comment |

## Quickstart

```bash
pnpm install
pnpm demo          # terminal demo, no MCP client needed
pnpm dev           # run the MCP server over stdio
pnpm check         # typecheck + tests
```

The server speaks MCP over stdio. Point any MCP-compatible client at `pnpm dev` (or the built `node dist/src/server.js`).

## Example tool call

```json
{
  "name": "list_issues",
  "arguments": { "status": "open", "limit": 5 }
}
```

```json
[
  {
    "id": 101,
    "title": "Agent stops after a tool error instead of retrying",
    "status": "open",
    "labels": ["agent", "reliability"]
  }
]
```

## Why this repo exists

It is a compact reference for:

- registering MCP tools with typed Zod schemas
- separating pure store logic from the transport
- testing tool behavior without an LLM
- shipping a stdio server with Docker and CI

## Structure

```text
src/store.ts     in-memory issue tracker + pure functions
src/server.ts    MCP server + tool registration
scripts/demo.ts  terminal demo
test/            Vitest tests
```

## Docker

```bash
docker build -t mcp-server-starter .
docker run --rm -i mcp-server-starter
```

## License

MIT