MCP Not working for Kimi-V2 via OpenRouter
Model & Provider : https://openrouter.ai/moonshotai/kimi-k2
Its picking up the tools but not calling them.
Note : not sure its related to Opencode.
Probably not helpful since you can do it dax but, see shitting copy paste:
AI_TypeValidationError: Type validation failed: Value: {"id":"gen- ┃ ┃ 1752464750- ┃ ┃ HLwrZnK0DDnaVIGZ2AxV","provider":"Novita","model":"moonshotai/kimi- ┃ ┃ k2","object":"chat.completion.chunk","created":1752464751,"choices":[{"ind ┃ ┃ ex":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0, ┃ ┃ "type":"","function":{"arguments":"{\""}}]},"finish_reason":null,"native_f ┃ ┃ inish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_23eba7cd"} ┃ ┃ . ┃ ┃ Error message: ┃ ┃ [{"code":"invalid_union","errors":[[{"code":"invalid_value","values":["fun ┃ ┃ ction"],"path":["choices",0,"delta","tool_calls",0,"type"],"message":"Inva ┃ ┃ lid input: expected ┃ ┃ \"function\""}],[{"expected":"object","code":"invalid_type","path":["error ┃ ┃ "],"message":"Invalid input: expected object, received ┃ ┃ undefined"}]],"path":[],"message":"Invalid input"}]
@rahulvramesh Can you please share the connection json for this?
{
"anthropic": {
"type": "oauth",
"refresh": "",
"access": "",
"expires": 1752311293775
},
"moonshot": {
"type": "api",
"key": ""
},
"openrouter": {
"type": "api",
"key": ""
}
}
am using the openrouter but paid model (not free)
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"openrouter": {
"name": "OpenRouter",
"models":{
"moonshotai/kimi-k2": {
"name": "OR Kimi-K2" # This is the one i have tested
}
}
},
"moonshot": {
"npm": "@ai-sdk/openai-compatible",
"name": "Moonshot",
"options": {
"baseURL": "https://api.moonshot.ai/v1"
},
"models": {
"kimi-latest": {
"name": "kimi-latest"
}
}
}
},
"mcp": {
"mcp-server-firecrawl": {
"type": "local",
"command": ["npx", "-y", "firecrawl-mcp"],
"enabled": true,
"environment": {
"FIRECRAWL_API_KEY": ""
}
},
"sequential-thinking": {
"type": "local",
"command": ["npx", "-y", "@modelcontextprotocol/server-sequential-thinking"],
"enabled": true
}
}
}
novita provider in openrouter is bugged