MCP Server
by Gaurav Kabra
The Model Context Protocol (MCP) is a standardized way for LLMs to interact with external tools and functions, injecting context into LLMs. It enables models to request real-time information, execute actions, access knowledge, and interact with APIs.
Last updated: N/A
MCP (Model Context Protocol)
by Gaurav Kabra
The Model Context Protocol (MCP) is a standardized way, introduced by Anthropic, for LLMs to interact with external tools and functions and injecting context in LLMs. It allows models to:
- Request real-time information
- Execute actions in external systems
- Access specialized knowledge
- Interact with APIs and services




So we improve and get to the 3rd figure, which is similar to:

An MCP server will expose 3 things:





You can refer this for above images.
Setup From Scratch
mkdir mcpserver
npm init
npm install @modelcontextprotocol/sdk
See this for official documentation.
Now in Cursor IDE, click on Settings cog -> MCP. Create the file mcp.json
and put below code:
{
"mcpServers": {
"Gaurav Kabra's MCP Server": {
"command": "node",
"args": ["/Users/gauravkabra/Desktop/MCPServer/index.js"]
}
}
}
Replace args
with absolute path (full path) of index.js
on your local.
And now it should show the add
tool available:

You can find documentation here.
Do CMD + I and ask to add two numbers and you should see a response which we coded in index.js
.
STDIO (Standard Input-Output) is ideal on local but for remote we use SSE transport (Server Sent Event). See this to know more.