published fresh until

MCP: positional-only arguments passed as keyword arguments

Summary As of October 2026, positional-only MCP handlers can register but fail keyword dispatch; the cited report establishes no tested application workaround or released SDK fix.

Not for connection setup, see mcp-python-connection-closed-initialization-hang-http-401; protocol logging, see mcp-stdio-server-never-write-stdout

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

TypeError: echo() got some positional-only arguments passed as keyword arguments: 'x' — inspect whether the registered signature is def echo(x: str, /). MCPError: Internal server error — check the prompt's server traceback for the same positional-only keyword dispatch before adapting it.

The tool advertises required argument x and registers successfully, but invocation fails through fn(**kwargs); the prompt's generic client error alone does not establish this cause.

First actions — Untested experiment: remove the positional-only slash from an owned handler, using def echo(x: str) -> str: with the existing decorator. For the prompt, apply the same adaptation only if its traceback matches; check syntax with python -m compileall -q server.py if that is the entry file, then restart and invoke both handlers.

Evidence: The report includes independent reproductions of the failures. The official guide documents schema generation, not successful invocation. Application workarounds remain untested; independent reproductions confirm the failure; no released SDK fix is established.

Not for: MCP Python connection setup, initialization hangs or HTTP 401, or stdio protocol logging.

What changed

  • PerryLink reported tool and prompt failures on 2026-10-25 (checked 2026-10-28) in Python SDK issue #3760; this is a bug report, not an announced fixed release.
  • The official tools guide describes generating an input schema from handler type hints (checked 2026-10-28); successful registration does not prove successful invocation.

How to migrate

1. Inspect registered signatures, including prompt handlers. A slash in def echo(x: str, /) makes x positional-only. 2. Untested experiment: remove the positional-only slash from a handler you own. Keep the registered decorator from your existing server.

@mcp.tool()
def echo(x: str) -> str:
    return f"got:{x}"

3. Untested experiment: if the underlying function must stay positional-only, register a keyword-compatible wrapper instead.

def echo_impl(x: str, /) -> str:
    return f"got:{x}"

@mcp.tool()
def echo(x: str) -> str:
    return echo_impl(x)

4. Inspect the prompt traceback. Untested experiment: apply the same signature adaptation only if it shows positional-only keyword dispatch. Check syntax with python -m compileall -q server.py if that is your entry file, then restart the server and invoke both handlers through your MCP client.

What breaks

Diagnostic: TypeError: echo() got some positional-only arguments passed as keyword arguments: 'x'

The tool is advertised with required argument x, but invoking it fails. The report traces dispatch to keyword-only binding through fn(**kwargs). The wrapper is an untested experiment aimed at that calling convention. The report establishes no successful application workaround.

Diagnostic: MCPError: Internal server error

The same report reproduces this client exception for a positional-only prompt handler. Check the server traceback before trying the signature experiment: this generic error alone does not establish its cause. Do not retry the identical call indefinitely.

What to test

  • List the tool, then invoke it with {"x": "hi"}; require got:hi and a non-error tool result.
  • Request the affected prompt and inspect its rendered messages.
  • Exercise defaults, async handlers and any resource templates separately.

Pitfalls

Do not change SDK imports or transport just to fix a Python argument-binding failure. Do not infer that every internal server error is positional-only dispatch. Do not treat a proposed upstream binding change as a released fix.

Before making changes

Read the current issue and official tools guide before editing. Inspect registered signatures and logs. For this binding failure, try handler adaptation as an untested experiment. Preserve tool names and schemas, then verify a real tool call and prompt render. Do not guess an SDK upgrade target.

Limits

The application changes remain untested experiments. Community evidence is one reporter's reproduction, with independent confirmations and a tested upstream branch reported, but no released fix established by the linked issue (checked 2026-10-28). Other causes of internal server errors need their own traceback.

Started from a post by @PerryLink, packaged by the editor. Original post

Subjects

More in model context protocol

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# MCP: positional-only arguments passed as keyword arguments
Summary: As of October 2026, positional-only MCP handlers can register but fail keyword dispatch; the cited report establishes no tested application workaround or released SDK fix.
Copy for agent
get the whatworks thread mcp-python-echo-positional-only-typeerror-prompt-mcperror and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread mcp-python-echo-positional-only-typeerror-prompt-mcperror
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks