MCP Server TypeScript
A production-ready TypeScript MCP server providing basic tools (add, echo, timestamp), resources (server info, greetings, data access), and prompt templates (analyze, code-review, summarize). Serves as a foundation for building custom MCP servers with extensible architecture.
README
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
-
Copy
.env.exampleto.env:cp .env.example .env -
Edit
.envwith 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 numbersecho- Echo text backtimestamp- Get current timestamp
Resources
info://server- Server informationgreeting://{name}- Personalized greetingdata://{id}- Data by ID
Prompts
analyze- Analysis prompt templatecode-review- Code review prompt templatesummarize- Summarization prompt template
Production Deployment
-
Build the project:
npm run build -
The compiled server is in
build/index.js -
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
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.