MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP Serverget user with id 1"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
π‘ MCP Server - Model Context Protocol (Node.js + TypeScript) β¨ Author
Name: Imane Lmzk Project: MCP Server Learning Implementation
π Overview
This project demonstrates a basic implementation of an MCP (Model Context Protocol) Server using Node.js and TypeScript.
The MCP server acts as a bridge between AI models and external tools/data sources, allowing structured communication via standardized protocols.
π§ What is MCP?
Model Context Protocol (MCP) is a protocol designed to allow AI systems to:
Access external tools (APIs, databases, services) Retrieve structured data Execute actions in a controlled environment
π Think of MCP as:
A middleware layer between an AI model and real-world systems.
ποΈ Architecture Client (AI / App) β βΌ MCP Server β βββ Tools (functions) βββ Resources (data) βββ External APIs / DB βοΈ Tech Stack Node.js TypeScript Express (optional for HTTP transport) JSON-RPC / HTTP π Project Structure mcp-server/ βββ src/ β βββ server.ts # MCP server entry point β βββ tools/ # Tool definitions β βββ resources/ # Data providers β βββ types/ # Type definitions βββ package.json βββ tsconfig.json π Getting Started
Install dependencies npm install
Run the server npm run dev
Server runs on:
http://localhost:3000 π MCP Core Concepts
Tools
Tools are functions exposed to the AI.
Example:
export const getUser = async (id: number) => { return { id, name: "Imane" }; }; 2. Resources
Resources provide structured data.
export const users = [ { id: 1, name: "Imane" }, { id: 2, name: "Ali" } ]; 3. Requests (JSON-RPC style)
Example request:
{ "method": "tools/getUser", "params": { "id": 1 } } 4. Response { "result": { "id": 1, "name": "Imane" } } π§ͺ Example Endpoint (Express) import express from "express"; import { getUser } from "./tools/getUser";
const app = express(); app.use(express.json());
app.post("/mcp", async (req, res) => { const { method, params } = req.body;
if (method === "tools/getUser") { const result = await getUser(params.id); return res.json({ result }); }
res.status(400).json({ error: "Unknown method" }); });
app.listen(3000, () => { console.log("MCP Server running on port 3000"); }); π‘ How MCP Works (Step-by-Step) Client sends a request MCP server interprets the method Calls the appropriate tool Returns structured response π Use Cases AI assistants accessing databases Automation systems API orchestration Tool-based AI agents π Learning Goals Understand MCP architecture Build tool-based APIs Structure backend for AI interaction Practice TypeScript backend patterns π§ Useful Commands npm run dev # Start server npm run build # Compile TypeScript npm start # Run production build π License
MIT
π§ Status
In Progress β Learning MCP concepts and real-world integration.
π‘ Final Insight
MCP is not just a server β itβs a design pattern for AI-integrated systems. Mastering it means understanding how AI interacts with real-world data and tools.
This server cannot be deployed
Maintenance
Related MCP Connectors
Nifty's MCP server β exposes tasks, projects, messages, and files as tools for AI agents.
MCP server for AI dialogue using various LLM models via AceDataCloud
Remote MCP server for supportsheep: run AI interviews and manage support content for your blog.
MCP server for progressive tool usage at any scale (see https://klavis.ai)
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceA Python implementation of the MCP server that enables AI models to connect with external tools and data sources through a standardized protocol, supporting tool invocation and resource access via JSON-RPC.1-
- -licenseNot gradedqualityNot gradedmaintenanceA 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.205 npm-
- FlicenseNot gradedqualityDmaintenanceAn educational MCP server that teaches implementing the Model Context Protocol from scratch, enabling AI models to discover and invoke tools via JSON-RPC over stdio.-
- AlicenseDqualityDmaintenanceA TypeScript MCP server demo supporting local Stdio and remote Streamable HTTP, demonstrating tool invocation for AI agents.2MIT