MCP Not working for Kimi-V2 via OpenRouter #653

Closed
opened 2026-02-16 17:27:44 -05:00 by yindo · 4 comments
Owner

Originally created by @rahulvramesh on GitHub (Jul 11, 2025).

Originally assigned to: @thdxr on GitHub.

Model & Provider : https://openrouter.ai/moonshotai/kimi-k2

Its picking up the tools but not calling them.

Note : not sure its related to Opencode.

Originally created by @rahulvramesh on GitHub (Jul 11, 2025). Originally assigned to: @thdxr on GitHub. Model & Provider : https://openrouter.ai/moonshotai/kimi-k2 Its picking up the tools but not calling them. Note : not sure its related to Opencode.
yindo closed this issue 2026-02-16 17:27:44 -05:00
Author
Owner

@swein commented on GitHub (Jul 13, 2025):

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"}]

@swein commented on GitHub (Jul 13, 2025): 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"}] `
Author
Owner

@ibrahimshadev commented on GitHub (Jul 15, 2025):

@rahulvramesh Can you please share the connection json for this?

@ibrahimshadev commented on GitHub (Jul 15, 2025): @rahulvramesh Can you please share the connection json for this?
Author
Owner

@rahulvramesh commented on GitHub (Jul 15, 2025):

{
  "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
    }
  }
}
@rahulvramesh commented on GitHub (Jul 15, 2025): ```json { "anthropic": { "type": "oauth", "refresh": "", "access": "", "expires": 1752311293775 }, "moonshot": { "type": "api", "key": "" }, "openrouter": { "type": "api", "key": "" } } ``` am using the openrouter but paid model (not free) ```json { "$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 } } } ```
Author
Owner

@thdxr commented on GitHub (Jul 15, 2025):

novita provider in openrouter is bugged

@thdxr commented on GitHub (Jul 15, 2025): novita provider in openrouter is bugged
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#653