my-first-mcp
A local MCP server that connects Claude Desktop to execute custom local code, such as generating custom greetings.
README
My First MCP Server 🚀
Welcome! I built this project to explore and implement my own Model Context Protocol (MCP) server. This server connects a local development environment to an AI assistant (Claude Desktop), allowing the AI to execute custom local code.
🧠 What is MCP?
The Model Context Protocol (MCP) is an open standard introduced by Anthropic. Think of it like a USB-C cable for AI models.
Normally, Large Language Models (LLMs) are isolated in the cloud. They can't see your local files, interact with your databases, or run your internal scripts. MCP solves this by providing a standardized, secure way for AI models to connect to external tools and data sources.
🎯 Purpose and Use Cases
The purpose of this project is to demonstrate how to break an AI out of its isolated bubble. By building an MCP server, we give the AI a "menu" of tools it can use.
Why is this powerful?
- Local File Access: You can build tools that let the AI read your local codebase or logs.
- Live Data Fetching: The AI can trigger API calls (like fetching live weather, stock prices, or database queries) and read the responses.
- Task Automation: The AI can execute local scripts on your behalf.
This specific project features a Greeting Tool that takes a user's name as input from the AI and returns a custom formatted greeting generated entirely on the local machine.
⚙️ Step-by-Step Setup Guide
If you want to run this MCP server on your own machine, follow these instructions carefully.
Prerequisites
- Node.js (v18 or higher) installed on your machine.
- Claude Desktop App installed and logged in.
1. Installation
Clone this repository to your local machine and install the required dependencies:
git clone <github-repo-url>
# 1. Create a new folder and move into it
mkdir my-first-mcp
cd my-first-mcp
# 2. Initialize a blank Node.js project (creates a package.json file)
npm init -y
# 3. Install the official MCP SDK
npm install @modelcontextprotocol/sdk
# 4. Install TypeScript tools for development
npm install -D typescript @types/node ts-node
# 5. Create a basic TypeScript configuration file
npx tsc --init
2. Compile the TypeScript Code
This project is written in modern TypeScript. You need to compile it into JavaScript so Node.js can run it.
Run the following command in your terminal:
Bash
npx tsc
Note: This will generate a new dist folder containing the compiled index.js file.
3. Get Your Absolute Path
Claude Desktop needs to know exactly where this compiled file lives on your computer.
Open the new dist folder.
Right-click on index.js and select Copy Path (You need the full absolute path, e.g., C:\Users\Name\Desktop\my-first-mcp\dist\index.js).
4. Configure Claude Desktop
You need to link your local server to the Claude app.
Open the Claude Desktop app.
Go to Settings > Developer > Edit Config.
This will open a file named claude_desktop_config.json. Add the following configuration, replacing the args path with the absolute path you copied in the previous step:
JSON
{
"mcpServers": {
"my-first-mcp": {
"command": "node",
"args": ["C:/YOUR/ABSOLUTE/PATH/HERE/dist/index.js"],
"env": {}
}
}
}
Windows Users: Ensure your path uses forward slashes / or double backslashes \\.
5. Restart and Test
Fully close Claude Desktop (ensure it is quit from the system tray).
Reopen the application.
Start a new chat. You should see a small "plug" or "hammer" icon indicating local tools are connected.
Prompt Claude: "Use your tools to greet [Your Name]."
Watch as Claude routes the request to your local Node.js server and returns the custom response!
Built by Imran
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.
Neon Database
MCP server for interacting with Neon Management API and databases
E2B
Using MCP to run code via e2b.
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.