Skip to main content
Glama
idapixl

MCP Starter Kit

by idapixl

MCP Server Starter Kit

A production-ready TypeScript template for building Model Context Protocol (MCP) servers. Skip the boilerplate and ship working tools to Claude and other MCP clients in minutes.

What's included

  • Working MCP server using the official @modelcontextprotocol/sdk

  • 3 example tools you can use as-is or adapt:

    • fetch_url — fetch web content with configurable limits and domain blocking

    • read_file / list_directory — safe filesystem access with path traversal protection

    • transform_data — convert between JSON, CSV, TSV, Markdown table, and plain text

  • TypeScript throughout — strict mode, typed inputs/outputs, Zod validation

  • Error handling patterns — every tool returns a typed ToolResult<T> with ok/error discrimination

  • Environment-based config — all limits and paths configurable via .env

  • Structured logging — stderr-only logger (MCP protocol uses stdout)

  • Test suite — 19 tests with Vitest covering all three tools

  • Build scriptsnpm run build, npm run dev, npm test, npm run typecheck

Related MCP server: MCP Base Server

Requirements

  • Node.js 18 or higher

  • npm 9 or higher

Quick start

# 1. Install dependencies
npm install

# 2. Configure environment
cp .env.example .env
# Edit .env — at minimum, set FILE_READER_ROOT to a safe directory

# 3. Build
npm run build

# 4. Run
npm start

Development mode

npm run dev

Uses tsx for live reload — no build step required during development.

Connect to Claude Desktop

Add this to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS, %APPDATA%\Claude\claude_desktop_config.json on Windows):

{
  "mcpServers": {
    "my-server": {
      "command": "node",
      "args": ["/absolute/path/to/mcp-starter-kit/dist/index.js"],
      "env": {
        "FILE_READER_ROOT": "/path/to/allowed/directory",
        "LOG_LEVEL": "info"
      }
    }
  }
}

Restart Claude Desktop. Your tools will appear in the tool picker.

Connect to Claude Code

Add to .claude/settings.json:

{
  "mcpServers": {
    "my-server": {
      "command": "node",
      "args": ["/absolute/path/to/mcp-starter-kit/dist/index.js"]
    }
  }
}

Tools reference

fetch_url

Fetches the text content of a URL.

Parameter

Type

Required

Description

url

string

yes

HTTP or HTTPS URL to fetch

headers

object

no

Additional request headers

timeout_ms

number

no

Request timeout (100–30000ms, default from env)

Returns the response body, status code, content type, and a truncated flag if the response exceeded FETCH_MAX_BYTES.

read_file

Reads a file within the configured FILE_READER_ROOT.

Parameter

Type

Required

Description

path

string

yes

Relative path from root

encoding

utf8 or base64

no

Encoding (default: utf8)

max_bytes

number

no

Max bytes to read (default: 1MB)

Path traversal (../) is blocked at the resolver level.

list_directory

Lists files and directories within the configured root.

Parameter

Type

Required

Description

path

string

no

Relative directory path (default: .)

recursive

boolean

no

List nested files (default: false)

transform_data

Converts data between formats.

Parameter

Type

Required

Description

input

string

yes

Raw input data

from_format

json|csv|tsv|text

yes

Input format

to_format

json|csv|tsv|markdown_table|text_summary

yes

Output format

options.pretty

boolean

no

Pretty-print JSON (default: true)

options.include_header

boolean

no

Include CSV/TSV header row (default: true)

options.delimiter

string

no

Custom delimiter for CSV/TSV parsing

Configuration

All configuration is via environment variables. See .env.example for the full list.

Variable

Default

Description

SERVER_NAME

mcp-starter-kit

Server identity reported to clients

SERVER_VERSION

1.0.0

Server version

FETCH_MAX_BYTES

1048576

Max response size for web fetcher (bytes)

FETCH_TIMEOUT_MS

10000

Default fetch timeout (ms)

FETCH_BLOCKED_DOMAINS

(empty)

Comma-separated blocked hostnames

FILE_READER_ROOT

./workspace

Root directory for file access

TRANSFORMER_MAX_INPUT

50000

Max input characters for transformer

LOG_LEVEL

info

Logging level (debug/info/warn/error)

Adding your own tools

  1. Create src/tools/my-tool.ts — export an async function that returns ToolResult<YourType>

  2. Add input/output types to src/types.ts using Zod schemas

  3. Register the tool in src/index.ts with server.tool(name, description, schema, handler)

  4. Write tests in src/tools/my-tool.test.ts

The pattern used by all three example tools:

export async function myTool(input: MyToolInput): Promise<ToolResult<MyToolOutput>> {
  // validate, execute, return { ok: true, data: ... } or { ok: false, error: "...", code: "..." }
}

Project structure

mcp-starter-kit/
├── src/
│   ├── index.ts          # Server entry point — tool registration
│   ├── config.ts         # Environment variable loading
│   ├── logger.ts         # Stderr logger
│   ├── types.ts          # Shared types and Zod schemas
│   └── tools/
│       ├── web-fetcher.ts
│       ├── web-fetcher.test.ts (add your own)
│       ├── file-reader.ts
│       ├── file-reader.test.ts
│       ├── data-transformer.ts
│       └── data-transformer.test.ts
├── dist/                 # Compiled output (after npm run build)
├── .env.example
├── package.json
├── tsconfig.json
└── vitest.config.ts

Running tests

npm test           # Run once
npm run test:watch # Watch mode

License

MIT

Available Tools

4 tools
fetch_urlA

Fetch the content of a URL and return it as text. Supports HTTP and HTTPS. Returns the response body, status code, and content type. Binary content (images, PDFs, etc.) is rejected — text and JSON only.

ParametersJSON Schema
NameRequiredDescriptionDefault
urlYes
headersNoOptional HTTP headers
timeout_msNoRequest timeout in milliseconds (100–30000)

TDQS

A4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes key traits: it returns response body, status code, and content type; rejects binary content; and supports specific protocols. However, it misses details like error handling, rate limits, or authentication needs, which would be useful for a fetch operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the core purpose and efficiently adds critical details in two sentences. Every sentence earns its place by specifying functionality, protocols, return values, and content restrictions without redundancy, making it highly concise and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (3 parameters, no output schema, no annotations), the description is mostly complete—it covers purpose, behavior, and limitations. However, it lacks details on error responses or output structure, which would enhance completeness for an agent invoking the tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 67% (2 out of 3 parameters have descriptions). The description adds no specific parameter semantics beyond what the schema provides—it mentions URL fetching generally but does not explain headers or timeout usage. With moderate schema coverage, the baseline score of 3 is appropriate as the description does not compensate for gaps.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('fetch the content of a URL') and resource ('URL'), distinguishing it from sibling tools like list_directory, read_file, and transform_data. It specifies the return format ('as text') and protocol support ('HTTP and HTTPS'), making the purpose unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage by mentioning protocol support and content restrictions ('text and JSON only'), but it does not explicitly state when to use this tool versus alternatives or provide context about prerequisites. It lacks direct guidance on scenarios where this tool is preferred over siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_directoryB

List files and directories. Paths are relative to the configured root (/app/workspace). Set recursive=true to list all nested files.

ParametersJSON Schema
NameRequiredDescriptionDefault
pathNoDirectory path relative to the configured root.
recursiveNoWhether to list files recursively
max_depthNoMaximum directory depth for recursive listing (default: 3, max: 10)
max_entriesNoMaximum total entries to return (default: 10000)

TDQS

B3.2/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions the root path configuration and recursive behavior, but it doesn't cover important aspects like whether this is a read-only operation, potential rate limits, error conditions (e.g., invalid paths), or what the output format looks like (since there's no output schema). For a tool with no annotations, this leaves significant gaps in understanding its behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is very concise and front-loaded: it states the core purpose in the first sentence, followed by key contextual details. Both sentences earn their place by providing essential information without redundancy. It's appropriately sized for the tool's complexity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has no annotations and no output schema, the description is incomplete. It covers basic purpose and some parameter hints but lacks crucial behavioral details (e.g., safety, errors, output format) and doesn't fully compensate for the missing structured data. For a 4-parameter tool with no annotations or output schema, this description should do more to guide the agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all parameters thoroughly. The description adds minimal value beyond the schema: it mentions the root path context and hints at the 'recursive' parameter's effect. However, it doesn't provide additional semantic context for parameters like 'max_depth' or 'max_entries' that aren't covered in the description. Baseline 3 is appropriate when the schema does most of the work.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'List files and directories.' It specifies the verb ('List') and resource ('files and directories'), making it easy to understand what the tool does. However, it doesn't explicitly differentiate from sibling tools like 'fetch_url' or 'read_file', though the distinction is somewhat implied by the domain.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides some usage context: 'Paths are relative to the configured root (/app/workspace). Set recursive=true to list all nested files.' This gives basic guidance on when to use certain parameters, but it doesn't explicitly state when to use this tool versus alternatives like 'fetch_url' or 'read_file', nor does it mention any exclusions or prerequisites.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

read_fileA

Read a file from the filesystem. Paths are relative to the configured root directory (/app/workspace). Path traversal (../) is blocked. Use encoding=base64 for binary files.

ParametersJSON Schema
NameRequiredDescriptionDefault
pathYesPath to the file, relative to the configured root directory
encodingNoFile encoding — use base64 for binary filesutf8
max_bytesNoMaximum bytes to read (default: 1MB, max: 10MB)

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden and does well by disclosing important behavioral traits: path traversal blocking, root directory context, and encoding recommendations for binary files. It doesn't mention error conditions, permissions, or rate limits, but provides solid operational context for a read operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three concise sentences with zero waste - each sentence provides essential information: core purpose, path constraints, and encoding guidance. Perfectly front-loaded with the main action first, followed by important operational details.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a read operation with no annotations and no output schema, the description provides good context about path handling and encoding. It could mention what happens with non-existent files or permission errors, but covers the essential operational constraints well given the tool's complexity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all parameters thoroughly. The description adds minimal value beyond the schema - it mentions encoding=base64 for binary files (which is also in the schema) and implies path handling context. Baseline 3 is appropriate when schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Read a file') and resource ('from the filesystem'), distinguishing it from sibling tools like list_directory (which lists files) or fetch_url (which retrieves from URLs). It provides specific context about path handling that makes the purpose unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context about when to use certain options ('use encoding=base64 for binary files') and mentions path traversal restrictions, but doesn't explicitly contrast when to use this tool versus alternatives like fetch_url or transform_data. It gives operational guidance but not sibling differentiation.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

transform_dataA

Convert data between formats: JSON, CSV, TSV, Markdown table, and plain text summary. Useful for reformatting API responses, preparing data for display, or normalising spreadsheet exports.

ParametersJSON Schema
NameRequiredDescriptionDefault
inputYesThe raw input data to transform
from_formatYesInput data format
to_formatYesDesired output format
optionsNo

TDQS

A3.7/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. While it mentions what the tool does, it doesn't describe important behavioral aspects like error handling, performance characteristics, rate limits, authentication requirements, or what happens with malformed input. The description is functional but lacks operational transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is perfectly concise with two sentences that each earn their place. The first sentence states the core functionality with specific format examples, and the second sentence provides usage contexts. No wasted words, front-loaded with the essential information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 4-parameter tool with no annotations and no output schema, the description is adequate but has clear gaps. It explains what the tool does and when to use it, but doesn't address output format details, error conditions, or behavioral constraints. Given the complexity and lack of structured metadata, more complete operational guidance would be helpful.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 75% schema description coverage, the baseline is 3. The description doesn't add specific parameter semantics beyond what's in the schema - it mentions format conversions generally but doesn't explain parameter interactions, constraints, or edge cases. The schema already documents parameters well, so the description doesn't compensate for the 25% coverage gap but doesn't need to either.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with specific verbs ('convert', 'reformat', 'prepare', 'normalise') and resources ('data between formats'), listing all supported formats. It distinguishes this from sibling tools (fetch_url, list_directory, read_file) by focusing on data transformation rather than data retrieval or file operations.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context for when to use this tool ('useful for reformatting API responses, preparing data for display, or normalising spreadsheet exports'), giving concrete scenarios. However, it doesn't explicitly state when NOT to use it or mention alternatives among sibling tools, which prevents a perfect score.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 4 tool updatesv1.0.0
    • First observedfetch_url
    • First observedlist_directory
    • First observedread_file
    • First observedtransform_data

TDQS

A3.9/5.0

Scored across 4 tools

Disambiguation5/5

Each tool has a clearly distinct purpose: fetch_url handles web content retrieval, list_directory deals with filesystem listing, read_file focuses on file reading, and transform_data manages data format conversion. There is no overlap in functionality, making tool selection straightforward for an agent.

Naming Consistency4/5

Three tools follow a consistent verb_noun pattern (fetch_url, list_directory, read_file), but transform_data uses a verb_adjective pattern, which is a minor deviation. Overall, the naming is readable and mostly predictable, with only one tool breaking the pattern slightly.

Tool Count5/5

With 4 tools, the server is well-scoped for a starter kit focused on basic web and filesystem operations. Each tool earns its place by covering distinct, essential tasks without being overly sparse or bloated, making it appropriate for its purpose.

Completeness4/5

The tool set covers core operations for web fetching, filesystem listing, file reading, and data transformation, with no obvious dead ends. However, there are minor gaps, such as no write_file tool for filesystem modifications, which agents might need to work around, but the surface is largely complete for a starter kit.

Maintenance

ActivityInactive
ResponsivenessUnresponsive

Related MCP Connectors

Related MCP Servers

  • -
    license
    Not graded
    quality
    Not graded
    maintenance
    A production-ready starter template for building Model Context Protocol (MCP) servers with TypeScript. Includes automated tooling for creating new MCP tools, testing, and deployment to Claude Desktop.
    22 npm
    -
  • A
    license
    Not graded
    quality
    D
    maintenance
    A TypeScript-based template for rapidly developing MCP servers with modular tool architecture, built-in validation using Zod schemas, and comprehensive error handling.
    5 npm
    MIT
  • A
    license
    A
    quality
    A
    maintenance
    Production-ready template for building MCP servers with TypeScript, featuring example tools and resources, and Claude Desktop integration.
    1
    6 npm
    MIT