mcpField
[
[Template] MCP Server

[Template] MCP Server

Local
github.com/larryhudsonDeveloper Tools1Updated 79w ago

About [Template] MCP Server

A template for developers creating TypeScript MCP servers, with guidance for adding tools, building, testing, and publishing. The README leaves the server’s specific tools and functionality for developers to define.

Key features

  1. 01TypeScript project template
  2. 02Add tools in src/index.ts
  3. 03npm build and publish guidance
  4. 04MCP Inspector testing guidance

Use cases

  1. 01Creating a TypeScript MCP server
  2. 02Defining and testing custom tools
  3. 03Building and publishing an npm package

MCP support

The template is for creating MCP servers that MCP-compatible applications can connect to; developers define which tools the server exposes.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"template-larryhudson": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/inspector"
]
}
}
}
Run commandnpx -y @modelcontextprotocol/inspector

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npm@modelcontextprotocol/inspector

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

[Template] MCP Server

How to use this template

  • Add tool definitions in src/index.ts
  • Update the README below
  • Update the placeholder info in package.json
  • Test building the MCP server with npm run build, and using the @modelcontextprotocol/inspector library
  • Publish to npm: npm login, npm publish --access public

Overview

[Insert overview here]

Features

[Insert features here]

Setup

  1. Create a API key etc.
  2. Set the token as an environment variable:
export API_KEY_ENV_VAR=the_secret_api_key

Usage

Using with VS Code

Add this to your settings JSON file:

{
  "mcp": {
    "inputs": [
      {
        "type": "promptString",
        "id": "some_secret_api_key",
        "description": "Secret API key",
        "password": true
      }
    ],
    "servers": {
      "[library-name]": {
        "command": "npx",
        "args": [
          "-y",
          "@larryhudson/[the-library]"
        ],
        "env": {
          "API_KEY_ENV_VAR": "${input:some_secret_api_key}"
        }
      }
    }
  }
}
Using with Claude or other MCP-compatible applications

Add this to your MCP configuration JSON file:

{
  "mcpServers": {
    "[the-library]": {
      "command": "npx",
      "args": ["-y", "@larryhudson/[the-library]"],
      "env": {
        "API_KEY_ENV_VAR": "<THE_SECRET_API_KEY>"
      }
    }
  }
}

Available Tools

[List the tools here]

How It Works

[Some info about how it works]

Technical Details

Built with:

  • Model Context Protocol (MCP): Framework for allowing AI assistants to interact with external tools
  • TypeScript: For type safety and better developer experience

Development

You can use the Model Context Protocol inspector to try out the server:

npx @modelcontextprotocol/inspector npx tsx src/index.ts

Limitations and Future Improvements

License

MIT

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.