The Unichat MCP Server allows you to send requests to various AI providers such as OpenAI, MistralAI, Anthropic, xAI, Google AI, DeepSeek, Alibaba, and Inception using the Model Context Protocol (MCP). It provides a unified interface for interacting with different AI models through predefined prompts or a general-purpose tool.
To integrate Unichat MCP Server with Claude Desktop, you need to modify the Claude Desktop configuration file located at:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%/Claude/claude_desktop_config.json
Add the server configuration with your selected model and API key:
"mcpServers": {
"unichat-mcp-server": {
"command": "uvx",
"args": [
"unichat-mcp-server"
],
"env": {
"UNICHAT_MODEL": "gpt-4o-mini",
"UNICHAT_API_KEY": "YOUR_OPENAI_API_KEY"
}
}
}
"mcpServers": {
"unichat-mcp-server": {
"command": "uv",
"args": [
"--directory",
"/path/to/your/unichat-mcp-server",
"run",
"unichat-mcp-server"
],
"env": {
"UNICHAT_MODEL": "gpt-4o-mini",
"UNICHAT_API_KEY": "YOUR_OPENAI_API_KEY"
}
}
}
For automatic installation, you can use Smithery:
npx -y @smithery/cli install unichat-mcp-server --client claude
The server implements a general-purpose tool called unichat
that can send requests to any supported AI provider.
The tool takes a required messages
argument and returns a response. Here's an example of how to use it:
unichat(messages="Your prompt or message here")
The server also provides several predefined prompts for common code-related tasks:
Use this prompt to review code for best practices, potential issues, and improvements:
code_review(code="function example() { console.log('Hello world'); }")
Generate documentation for code including docstrings and comments:
document_code(code="def add(a, b): return a + b")
Get a detailed explanation of how a piece of code works:
explain_code(code="import pandas as pd\ndf = pd.read_csv('data.csv')\nresult = df.groupby('category').sum()")
Apply specific changes to the provided code:
code_rework(
code="function greet(name) { return 'Hello ' + name; }",
changes="Convert to ES6 arrow function with template literals"
)
To specify which AI model to use, set the UNICHAT_MODEL
environment variable. You can find a list of supported models in the Unichat models.py file.
Remember to provide the corresponding API key for the vendor you're using in the UNICHAT_API_KEY
environment variable.
If you encounter issues, you can use the MCP Inspector for debugging:
npx @modelcontextprotocol/inspector uv --directory /path/to/your/unichat-mcp-server run unichat-mcp-server
The Inspector will provide a URL that you can open in your browser to help with debugging.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.