gptel icon indicating copy to clipboard operation
gptel copied to clipboard

[MCP] server failed to start

Open nfedyashev opened this issue 6 months ago • 1 comments

Please update gptel first -- errors are often fixed by the time they're reported.

  • [x] I have updated gptel to the latest commit and tested that the issue still exists

Bug Description

I wanted to see what latest MCP gptel integration look like.

I've tried a few MCP servers and in both cases it successfully spawns/starts MCP hub servers but MCP-Hub fail to register them.

Any hints on what I might be doing wrong are greatly appreciated

Backend

None

Steps to Reproduce

(setq mcp-hub-servers
      '(("sequential-thinking" :command "npx" :args ("-y" "@modelcontextprotocol/server-sequential-thinking"))))

;; (gptel-mcp-connect) ;; and type "sequential-thinking"

;; It fails with:
;; 1/1 server failed to start: sequential-thinking.  Run \[mcp-hub] to investigate.

;; If you open Mcp-Hub:
;; Mcp-Hub
;; sequential-thinking nil        stop            nil        nil        nil        nil

;; If you open sequential-thinking buffer - it started successfully
;; ;; *sequential-thinking* buffer
;; Sequential Thinking MCP Server running on stdio

Another server example, same error but different buffer content:

[18223] Using automatically selected callback port: 3334
[18223] [18223] Connecting to remote server: https://example.com/mcp/sse
[18223] Using transport strategy: http-first
[18223] Received error: Error POSTing to endpoint (HTTP 405): {"jsonrpc":"2.0","error":{"code":-32601,"message":"Method not allowed"},"id":null}
[18223] Recursively reconnecting for reason: falling-back-to-alternate-transport
[18223] [18223] Connecting to remote server: https://example.com/mcp/sse
[18223] Using transport strategy: sse-only
[18223] Connected to remote server using SSEClientTransport
[18223] Local STDIO server running
[18223] Proxy established successfully between local STDIO and remote SSEClientTransport
[18223] Press Ctrl+C to exit
[18223] [Remote→Local] ping
[18223] [Remote→Local] ping
[18223] [Remote→Local] ping
[18223] [Remote→Local] ping

Additional Context

Emacs 29.3 Debian

Backtrace


Log Information


nfedyashev avatar May 30 '25 15:05 nfedyashev

This doesn't look like a gptel issue.

What happens if you try starting the servers from mcp-hub instead? (Press s to start a server.)

karthink avatar May 30 '25 21:05 karthink