Content
# MCP Client
## Content
- Implement a basic Client to connect DeepSeek to the MCP ecosystem
- Core Architecture
- JSON-RPC 2.0
- What is RPC
- **Differences between MCP and Function Calling**
- API differences among various providers
- OpenAI / Anthropic / DeepSeek
- **Refer to 5ire's source code on how to unify API differences**
## MCP Architecture
https://modelcontextprotocol.io/docs/concepts/architecture
https://www.jsonrpc.org/
## MCP Client Implementation
https://modelcontextprotocol.io/quickstart/client
https://github.com/modelcontextprotocol/typescript-sdk
- MCP Server: https://github.com/pskill9/hn-server
- Inspector: https://github.com/modelcontextprotocol/inspector
## Differences between MCP and Function Calling
### MCP Tool Invocation
```mermaid
graph LR
LLM <--> MCP_Client <--> MCP_Server
```
- MCP Client and MCP Server have a strict communication protocol
- Server provides unified interface specifications and service registration mechanisms
- Client knows how to communicate with Server and available service lists
- Due to **unified protocol specifications**, tools developed by different developers can be easily reused by other MCP clients
- Server's registration mechanism makes tool discovery and sharing simple
### Function Calling Tool Invocation
```mermaid
graph LR
LLM <--> AnyClient <--> AnyServer
```
- More like a **basic capability** of the model, LLM only identifies the function to be called
- Client decides how to implement this function call
- No unified service discovery and communication standards
- Different clients' plugin ecosystems are not compatible with each other
- https://chat-plugin-sdk.lobehub.com/quick-start/get-start
- https://www.librechat.ai/docs/development/tools_and_plugins
## API Differences
https://platform.openai.com/docs/api-reference/chat
https://docs.anthropic.com/en/api/messages
https://api-docs.deepseek.com/api/create-chat-completion
- Differences
1. Function definition format for function calling
2. Data structure for function calling return
3. Message data structure after calling
## 5ire's Approach to Unifying API Differences
- APIs of different models return different data structures, how to unify the output of LLM models and MCP-client differences?
- Since we know they are different → we can convert them to be the same
- https://github.com/nanbingxyz/5ire
1. Different function definition methods → ChatService's makeTool handles
2. Different function call results → Reader's parseReply and parseTools handle
3. Different message formats → ChatService's makeToolMessages handles
Connection Info
You Might Also Like
everything-claude-code
Complete Claude Code configuration collection - agents, skills, hooks,...
markitdown
MarkItDown-MCP is a lightweight server for converting URIs to Markdown.
firecrawl
Firecrawl MCP Server enables web scraping, crawling, and content extraction.
cc-switch
All-in-One Assistant for Claude Code, Codex & Gemini CLI across platforms.
servers
Model Context Protocol Servers
servers
Model Context Protocol Servers