Zihin MCP Server
A proxy server that connects MCP clients to the Zihin.ai platform via HTTP, enabling management of AI agents, LLM models, and configuration templates. It provides tools for agent creation and resources for discovering tenant-specific agents and schema templates.
README
@zihin/mcp-server
Proxy MCP stdio-to-HTTP para a plataforma Zihin.ai. Conecta clientes MCP ao Zihin MCP Server via HTTP.
Cliente MCP <-stdio-> [@zihin/mcp-server] <-HTTP-> https://llm.zihin.ai/mcp
Inicio rapido
macOS / Linux:
ZIHIN_API_KEY=zhn_live_xxx npx @zihin/mcp-server
Windows (PowerShell):
$env:ZIHIN_API_KEY="zhn_live_xxx"; npx @zihin/mcp-server
Na pratica, a maioria dos clientes MCP (Claude Desktop, Cursor, etc.) define a variavel automaticamente via bloco
"env"na configuracao — nao e necessario definir manualmente no shell.
Configuracao
Claude Desktop
Adicione ao claude_desktop_config.json:
{
"mcpServers": {
"zihin": {
"command": "npx",
"args": ["-y", "@zihin/mcp-server"],
"env": {
"ZIHIN_API_KEY": "zhn_live_xxx"
}
}
}
}
Claude Code
Adicione ao .mcp.json do projeto:
{
"mcpServers": {
"zihin": {
"command": "npx",
"args": ["-y", "@zihin/mcp-server"],
"env": {
"ZIHIN_API_KEY": "zhn_live_xxx"
}
}
}
}
Ou via CLI (a variavel ZIHIN_API_KEY deve estar definida no shell):
claude mcp add zihin -e ZIHIN_API_KEY=zhn_live_xxx -- npx -y @zihin/mcp-server
Cursor
Adicione ao .cursor/mcp.json:
{
"mcpServers": {
"zihin": {
"command": "npx",
"args": ["-y", "@zihin/mcp-server"],
"env": {
"ZIHIN_API_KEY": "zhn_live_xxx"
}
}
}
}
Windsurf
Adicione ao ~/.windsurf/mcp.json:
{
"mcpServers": {
"zihin": {
"command": "npx",
"args": ["-y", "@zihin/mcp-server"],
"env": {
"ZIHIN_API_KEY": "zhn_live_xxx"
}
}
}
}
Codex (OpenAI)
Adicione ao ~/.codex/config.toml (ou .codex/config.toml no projeto):
[mcp_servers.zihin]
command = "npx"
args = ["-y", "@zihin/mcp-server"]
env_vars = ["ZIHIN_API_KEY"]
A variavel ZIHIN_API_KEY deve estar definida no seu shell. Alternativamente, para definir inline:
[mcp_servers.zihin]
command = "npx"
args = ["-y", "@zihin/mcp-server"]
[mcp_servers.zihin.env]
ZIHIN_API_KEY = "zhn_live_xxx"
Outros clientes MCP
Qualquer cliente que suporte o protocolo MCP via stdio pode usar este pacote. O padrao de configuracao e o mesmo: executar npx -y @zihin/mcp-server com a variavel ZIHIN_API_KEY definida.
Variaveis de ambiente
| Variavel | Obrigatoria | Descricao |
|---|---|---|
ZIHIN_API_KEY |
Sim | API Key do tenant (formato zhn_live_*, zhn_test_* ou zhn_dev_*) |
ZIHIN_MCP_URL |
Nao | URL do MCP Server (default: https://llm.zihin.ai/mcp) |
Como funciona
O pacote atua como um proxy transparente entre o cliente MCP local (via stdio) e o Zihin MCP Server (via HTTP):
- Todas as tools, resources e prompts sao descobertos automaticamente do server
- Auth, RBAC e tenant isolation sao enforced server-side via API Key
- O role (admin/editor/member) e determinado pela API Key
Capabilities
As capabilities disponiveis dependem do role da API Key, controlado server-side:
| Role | Tools | Resources | Prompts |
|---|---|---|---|
admin |
Todas | 3 | 3 |
editor |
Todas (write guardado) | 3 | 3 |
member |
Subset (consumer) | - | - |
O numero exato de tools pode variar conforme o server evolui.
Resources disponiveis
| URI | Descricao |
|---|---|
zihin://agents |
Lista de agentes do tenant |
zihin://models |
Catalogo de modelos LLM disponiveis |
zihin://schema-templates |
Templates de schema para configuracao |
Prompts disponiveis
| Nome | Descricao |
|---|---|
setup-agent |
Cria um agente completo (agente + persona + tools + publicacao) |
add-tool |
Adiciona uma tool a um agente existente |
configure-webhook |
Configura trigger webhook para um agente |
Testes
O projeto inclui 19 testes de integracao real contra o server de producao:
ZIHIN_API_KEY=zhn_live_xxx npm test
Cobertura: validacao de API Key, tools (incluindo chat_with_agent com session tracking), resources, prompts e protocolo MCP.
Troubleshooting
"ERRO: ZIHIN_API_KEY nao definida"
Defina a variavel de ambiente antes de rodar:
# macOS / Linux
ZIHIN_API_KEY=zhn_live_xxx npx @zihin/mcp-server
# Windows (PowerShell)
$env:ZIHIN_API_KEY="zhn_live_xxx"; npx @zihin/mcp-server
"Falha ao conectar ao server"
- Verifique sua conexao com a internet
- Verifique se a API Key e valida e esta ativa
- Se usar URL customizada, verifique
ZIHIN_MCP_URL
Tools nao aparecem no cliente
- Reinicie o cliente MCP apos alterar a configuracao
- Claude Desktop: verifique logs em
~/Library/Logs/Claude/mcp*.log(macOS) ou%APPDATA%\Claude\logs\mcp*.log(Windows)
Requisitos
- Node.js >= 18
- Compativel com macOS, Linux e Windows
Licenca
MIT
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.