home / mcp / unichat mcp server
Provides an MCP server to route messages to Unichat for AI model interactions via the MCP protocol.
Configuration
View docs{
"mcpServers": {
"amidabuddha-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"
}
}
}
}You run a Python-based MCP server that exposes a single tool, unichat, to send requests to large language models and AI services via the MCP protocol. This server is designed to be started locally or wired up behind an MCP client, enabling you to interact with models such as OpenAI, MistralAI, and others through a consistent, scriptable interface.
You connect to the Unichat MCP server from your MCP client to send messages to the unichat tool. The server exposes a single tool named unichat that takes messages as input and returns a response. You can use this to compose prompts, chain messages, and receive model-generated outputs in a structured MCP workflow. When you configure your MCP client, point it at the MCP server entry and call the unichat tool with the required messages argument. Ensure you have a valid API key for the target vendors and select the appropriate model for your use case.
Prerequisites you need before installation:
- Node.js and npm or uvx/uv, depending on how you plan to run the MCP server.
- A vendor API key configured for the Unichat tool. Keep your key secure and do not share it in public files.
{
"mcpServers": {
"unichat_dev": {
"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"
}
},
"unichat_prod": {
"command": "uvx",
"args": [
"unichat-mcp-server"
],
"env": {
"UNICHAT_MODEL": "SELECTED_UNICHAT_MODEL",
"UNICHAT_API_KEY": "YOUR_UNICHAT_API_KEY"
}
}
}
}The server includes a set of prompts designed for code understanding and documentation tasks. These prompts enable you to review code for best practices, generate documentation with docstrings, explain how code works in detail, and rework code based on requested changes.
If you encounter issues starting the MCP server, check that your environment variables are set correctly and that the path to the local source directory exists. Use the MCP Inspector during debugging to inspect the stdio communication between the client and server and to view the live start URL.
Keep your API keys secure by storing them in environment variables, not in code. Restrict access to the MCP server to trusted clients and consider rotating keys periodically. Monitor usage to detect unusual activity and set appropriate quotas if your MCP client supports them.
You can configure and start development and production instances as shown in the configuration snippet above. The development setup uses a local directory for the server, while the production setup runs through the published MCP server binary. Always ensure you are using the correct model and key for your environment.
Send a request to unichat with the required messages argument and receive a response.
Review code for best practices, potential issues, and improvements. Arguments: code (string, required).
Generate documentation for code including docstrings and comments. Arguments: code (string, required).
Explain how a piece of code works in detail. Arguments: code (string, required).
Apply requested changes to the provided code. Arguments: changes (string, optional), code (string, required).