mcp-server-temp

ichetanmittal/mcp-server-temp

3.2

If you are the rightful owner of mcp-server-temp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

A production-ready Model Context Protocol (MCP) server built with TypeScript.

Tools
3
Resources
0
Prompts
0

MCP Server - TypeScript

A production-ready Model Context Protocol (MCP) server built with TypeScript.

Features

  • Tools: Execute actions (add, echo, timestamp)
  • Resources: Access data (server info, greetings, data by ID)
  • Prompts: Reusable prompt templates (analyze, code-review, summarize)

Project Structure

mcp-server/
├── src/
│   ├── index.ts              # Main server entry point
│   ├── tools/                # Tool implementations
│   │   └── index.ts
│   ├── resources/            # Resource handlers
│   │   └── index.ts
│   ├── prompts/              # Prompt templates
│   │   └── index.ts
│   └── utils/                # Helper functions
│       └── helpers.ts
├── build/                    # Compiled output (generated)
├── .env.example              # Environment template
├── .gitignore
├── package.json
├── tsconfig.json
└── README.md

Installation

cd mcp-server
npm install

Configuration

  1. Copy .env.example to .env:

    cp .env.example .env
    
  2. Edit .env with your configuration:

    SERVER_NAME=mcp-server
    SERVER_VERSION=1.0.0
    

Development

Build and run the server:

npm run build
npm run dev

Testing with Claude Desktop

Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json):

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

Available Capabilities

Tools

  • add - Add two numbers
  • echo - Echo text back
  • timestamp - Get current timestamp

Resources

  • info://server - Server information
  • greeting://{name} - Personalized greeting
  • data://{id} - Data by ID

Prompts

  • analyze - Analysis prompt template
  • code-review - Code review prompt template
  • summarize - Summarization prompt template

Production Deployment

  1. Build the project:

    npm run build
    
  2. The compiled server is in build/index.js

  3. Run with:

    node build/index.js
    

Adding New Capabilities

New Tool

Edit src/tools/index.ts and add:

server.registerTool(
  'tool-name',
  {
    title: 'Tool Title',
    description: 'Tool description',
    inputSchema: {
      param: z.string().describe('Parameter description'),
    },
  },
  async ({ param }) => {
    // Implementation
    return {
      content: [{ type: 'text', text: 'result' }],
    };
  }
);

New Resource

Edit src/resources/index.ts and add:

server.registerResource(
  'resource-name',
  new ResourceTemplate('scheme://{param}', { list: undefined }),
  {
    title: 'Resource Title',
    description: 'Resource description',
  },
  async (uri, { param }) => {
    return {
      contents: [{ uri: uri.href, text: 'data' }],
    };
  }
);

New Prompt

Edit src/prompts/index.ts and add:

server.registerPrompt(
  'prompt-name',
  {
    title: 'Prompt Title',
    description: 'Prompt description',
  },
  async () => {
    return {
      messages: [
        {
          role: 'user',
          content: { type: 'text', text: 'prompt text' },
        },
      ],
    };
  }
);

License

MIT