Create a Python and TypeScript MCP server for AI model requests with code review and code explanation tools
The Unichat MCP (Model Context Protocol) Server is a powerful tool designed to facilitate seamless integration of various AI applications with external data sources and tools. By leveraging the Model Context Protocol, this server ensures compatibility across different platforms and enhances the functionality of AI models like Claude Desktop, Continue, Cursor, and more. The OpenAI, MistralAI, Anthropic, xAI, Google AI, DeepSeek, Alibaba, Inception, and other vendors are supported, making it a versatile solution for developers looking to build robust and interoperable AI systems.
The Unichat MCP Server offers several core capabilities that make it an essential component in modern AI ecosystems. These features include:
Tool Integration: The server supports the execution of various tools through MCP, allowing users to send requests such as code reviews or documentation generation directly from supported AI clients.
unichat(messages="Send a request to Unichat")
Prompt-Based Interactions: Users can interact with the server via predefined prompts that trigger specific actions, such as reviewing code, generating documentation, explaining code functionality, or even reworking existing code.
code_review
: Reviews provided code for best practices and potential issues.document_code
: Generates documentation based on the given code, including docstrings and comments.explain_code
: Expands on how a specific piece of code works in detail.code_rework
: Applies changes to the existing code.Vendor API Key Support: To function properly, the server requires an API key from vendors such as OpenAI, MistralAI, Anthropic, xAI, Google AI, DeepSeek, Alibaba, and Inception. This ensures controlled access and maintains privacy while facilitating seamless interactions with these powerful tools.
The architecture of the Unichat MCP Server is built to ensure compatibility and maintainability across various environments. Here's a quick overview:
Tool Implementation: The server implements one primary tool, unichat
, which allows users to send requests to Unichat for various purposes.
unichat(messages="Send a request to Unichat")
Prompt Handling: It supports specific prompts like code_review
, document_code
, explain_code
, and code_rework
. Each prompt is designed to handle different tasks, such as code analysis, documentation generation, or reworking existing code.
code_review
: Reviews the provided code for best practices.document_code
: Generates documentation based on the given code.explain_code
: Explains how a piece of code works in detail.code_rework
: Applies changes to the existing code.Vendor API Key Configuration: The server configuration includes support for vendors' API keys, ensuring that all interactions remain secure and effective. Users must adhere to proper key management practices to maintain smooth operations.
The following models are currently supported:
Example Configuration:
"env": {
"UNICHAT_MODEL": "gpt-4o-mini",
"UNICHAT_API_KEY": "YOUR_OPENAI_API_KEY"
}
For development purposes or for servers that are not yet published, you can configure the MCP server in your client settings like so:
"mcpServers": {
"unichat-mcp-server": {
"command": "uv",
"args": [
"--directory",
"{{your source code local directory}}/unichat-mcp-server",
"run",
"unichat-mcp-server"
],
"env": {
"UNICHAT_MODEL": "SELECTED_UNICHAT_MODEL",
"UNICHAT_API_KEY": "YOUR_UNICHAT_API_KEY"
}
}
}
For published servers, the configuration is slightly different:
"mcpServers": {
"unichat-mcp-server": {
"command": "uvx",
"args": [
"unichat-mcp-server"
],
"env": {
"UNICHAT_MODEL": "SELECTED_UNICHAT_MODEL",
"UNICHAT_API_KEY": "YOUR_UNICHAT_API_KEY"
}
}
}
To install Unichat for Claude Desktop automatically, use the following command:
npx -y @smithery/cli install unichat-mcp-server --client claude
Imagine a development team using Unichat MCP Server to perform routine code reviews. They can send snippets of code directly from their AI client and receive detailed feedback, ensuring the quality of the software they develop.
A content creator might use the document_code
prompt to generate documentation automatically based on a piece of code they have written. This saves time and helps maintain consistency across projects while ensuring that all necessary documentation is always up-to-date.
The Unichat MCP Server supports integration with various AI clients, including Claude Desktop, Continue, Cursor, and others. Here’s the current compatibility matrix:
MCP Client | Resources | Tools | Prompts | Status |
---|---|---|---|---|
Claude Desktop | ✅ | ✅ | ✅ | Full Support |
Continue | ✅ | ✅ | ❌ | Tools Only |
Cursor | ❌ | ✅ | ❌ | Tools Only |
The server has been rigorously tested to ensure optimal performance and compatibility with various environments. While the primary focus is on supporting key clients, some tools might only be partially supported currently.
graph TD
A[AI Application] -->|MCP Client| B[MCP Protocol]
B --> C[MCP Server]
C --> D[Data Source/Tool]
style A fill:#e1f5fe
style C fill:#f3e5f5
style D fill:#e8f5e8
{
"mcpServers": {
"unichat-mcp-server": {
"command": "uv",
"args": [
"--directory",
"{{your source code local directory}}/unichat-mcp-server",
"run",
"unichat-mcp-server"
],
"env": {
"UNICHAT_MODEL": "SELECTED_UNICHAT_MODEL",
"UNICHAT_API_KEY": "YOUR_UNICHAT_API_KEY"
}
}
}
}
Q: Does Unichat MCP Server support all AI clients?
Q: Can I run this server on Windows or MacOS?
Q: How do I configure API keys for various vendors?
"YOUR_UNICHAT_API_KEY"
in your environment setup to ensure secure interactions with the server.Q: What tools are supported out-of-the-box?
Q: Can I debug the server directly from my AI client?
To prepare the package for distribution:
rm -rf dist
uv sync
uv build
This will create source and wheel distributions in the dist/
directory.
uv publish --token {{YOUR_PYPI_API_TOKEN}}
Since MCP servers run over stdio, debugging can be challenging. For the best debugging experience, we strongly recommend using the MCP Inspector.
You can launch the MCP Inspector via npm
with this command:
npx @modelcontextprotocol/inspector uv --directory {{your source code local directory}}/unichat-mcp-server run unichat-mcp-server
Upon launching, the Inspector will display a URL that you can access in your browser to begin debugging.
Explore further by visiting our community forums and documentation pages:
By leveraging the Unichat MCP Server, developers can significantly enhance their AI application's capabilities, ensuring seamless integration with diverse tools and resources. Embrace the power of MCP and transform your projects for a more connected and intelligent future!
Learn to connect to MCP servers over HTTP with Python SDK using SSE for efficient protocol communication
Next-generation MCP server enhances documentation analysis with AI-powered neural processing and multi-language support
Python MCP client for testing servers avoid message limits and customize with API key
Analyze search intent with MCP API for SEO insights and keyword categorization
Learn how to use MCProto Ruby gem to create and chain MCP servers for custom solutions
Discover easy deployment and management of MCP servers with Glutamate platform for Windows Linux Mac