Understanding MCP and Its Integration with auto-coder.chat

What is MCP
What is MCP (Model Context Protocol)? There are many complex explanations online, so I will try to clarify it here.
To understand a process or technology, we first look at the problems it aims to solve and its evolution. To enable models to not only output text (including images, audio, and video) but also call external tools, OpenAI first proposed the function calling feature. The specific approach is that the large model outputs a specific format of JSON text to describe the function name and parameter values you provide. You write your own code to parse this JSON text and then call the function. This way, the large model can invoke functions, and the logic within the function is defined by you. Up to this point, OpenAI only provides a standard; you provide the function definition, and they give you the JSON for the function to call and its parameters. Everything else must be done by you.
For example, if you want the large model to automatically call GitHub’s push API, you need to define a function that implements the call to the GitHub API, convert that function into the format accepted by OpenAI, send it to them, parse the values returned according to OpenAI’s specifications, and finally execute that function.
Now, MCP aims to standardize this process by providing you with a client SDK and a server SDK. As long as your client (like your front-end page) and server (like the GitHub API service) are implemented according to this standard, you can call your own or any third-party functions exposed by MCP. So, do you understand the value of MCP now?
Two points: first, it standardizes function calling; second, as long as all APIs are re-exposed through MCP Server, the large model can directly call all APIs in the world, enabling it to manipulate everything.

In fact, not only do all APIs need to be rebuilt/exposed for the large model, but all technical documentation and programming language interfaces in the world must also be rebuilt and exposed for the large model. This is the trend…

Learn More About MCP
You can also place MCP documentation in the auto-coder.RAG knowledge base, allowing you to ask questions freely, as if you have an MCP expert guiding you, including developing MCP Server.
https://uelng8wukz.feishu.cn/wiki/DrPBwMibYicUv8k6fSjcVC7dned?fromScene=spaceOverview
How to Use MCP Server with auto-coder.chat
Currently, there are at least a thousand MCP Servers implemented. You can install an MCP Server with a single command in auto-coder.chat and then use that Server. Here, we will introduce the specific method using the API from https://www.perplexity.ai/ as an example.
Execute the following command to view the existing MCP servers:
/mcp /list
Understanding MCP and Its Integration with auto-coder.chat
Install by name:
/mcp /add perplexity
Understanding MCP and Its Integration with auto-coder.chat
If you are installing a third-party server, the system will automatically install the necessary dependencies via pip/npx. Please ensure your computer has pip/npx commands. If not, the system will remind you.
Since perplexity requires an API Key for access, you need to manually add the Key.

Manually modify the file `~/.auto-coder/mcp/settings.json`:

{  "mcpServers": {    "perplexity": {      "command": "python",      "args": [        "-m",        "autocoder.common.mcp_servers.mcp_server_perplexity"      ],      "env": {        "PERPLEXITY_API_KEY": "{{PERPLEXITY_API_KEY}}"      }    }  }

Replace the entire <span>{{PERPLEXITY_API_KEY}}</span> with your actual API Key. Then refresh:

/mcp /refresh perplexity

Now, I can use /mcp to ask some questions:

/mcp Help me search what auto-coder.chat is.
Understanding MCP and Its Integration with auto-coder.chat

Here, we guide auto-coder.chat to use the tool provided by perplexity for searching by saying “Help me search.”

You can also use the following command to view the currently registered servers:

/mcp /list_running 
Understanding MCP and Its Integration with auto-coder.chat

Summary

You can quickly obtain information or perform various operations (like Git; you can refer to the above method to install mcp-server-git) through mcp in auto-coder.chat, thus eliminating the need to learn how to use Git commands.

Finally, here is the documentation link:

https://uelng8wukz.feishu.cn/wiki/A5CkwBSHki9KNCktAeIcxKKInWc?fromScene=spaceOverview

Leave a Comment