mcp_server
The Model Context Protocol (MCP) is designed to facilitate secure connections between data sources and AI applications through a client-server architecture. It supports developers in exposing data via MCP servers and building AI-driven MCP clients.
MCP - Model Context Protocol
About MCP
The Model Context Protocol (MCP) is an open standard that enables developers to build secure, two-way connections between their data sources and AI-powered tools. The architecture is straightforward: developers can either expose their data through MCP servers or build AI applications (MCP clients) that connect to these servers.
š Learn more
MCP follows a client-server architecture where a host application can connect to multiple servers.
Architecture
src/ ā TypeScript source
build/ ā Compiled JavaScript
```bash
weather/
āāā src/ # TypeScript source
ā āāā index.ts
āāā build/ # Compiled JavaScript
ā āāā index.js
āāā tsconfig.json
āāā package.json
src/
Directory (TypeScript Source)
Purpose:
- Contains development-time code written in TypeScript
- You implement MCP protocol handlers here (Resources, Tools, Prompts)
- Also contains logic, type definitions, SDKs, etc.
Key Files:
index.ts
ā Entry point for your MCP server- MCP concepts:
resources/
ā MCP Resource implementationstools/
ā LLM-callable functionsprompts/
ā Prompt templates / management
build/
Directory (Compiled JavaScript)
Purpose:
- Holds runtime code after TS compilation
- This is the folder Claude Desktop interacts with via:
node build/index.js
Traits:
- Compiled, production-ready JavaScript
- No TS needed after this stage
- Clean deployable output
āļø Data Flow Pipeline
graph LR
A[Developer Writes TS Code] --> B[src/index.ts]
B --> C[TypeScript Compiler tsc]
C --> D[build/index.js]
D --> E[Node.js Runtime]
E --> F[Claude Desktop IPC]
What Happens After index.js
Once your index.js
is ready, it flows like this:
Claude Desktop ā stdio ā Server Transport ā McpServer ā Tools (1)