opencode icon indicating copy to clipboard operation
opencode copied to clipboard

MCP Not working for Kimi-V2 via OpenRouter

Open rahulvramesh opened this issue 1 year ago • 4 comments

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

Its picking up the tools but not calling them.

Note : not sure its related to Opencode.

rahulvramesh avatar Jul 12 '25 01:07 rahulvramesh

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 avatar Jul 14 '25 03:07 swein

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

ibrahimshadev avatar Jul 15 '25 06:07 ibrahimshadev

{
  "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 avatar Jul 15 '25 07:07 rahulvramesh

novita provider in openrouter is bugged

thdxr avatar Jul 15 '25 13:07 thdxr