Skip to content

[FEATURE] --permission-prompt-tool needs minimal, working example and documentation for MCP integration with Claude Code CLI #1175

Description

@gwpl

Environment

  • Platform (select one):
    • Anthropic API
  • Claude CLI version: 0.2.120 (Claude Code)
  • Operating System: Linux Desktops and Servers (ArchLinux, Ubuntu, Alpine, NixOS, etc)

Bug Description

There is currently no minimal, working, documented example for implementing an MCP server to handle permission prompts via the --permission-prompt-tool flag in the Claude Code CLI. Attempts to create such a server (see e.g. CLIAI/mcp_permission_server_claude_code) using either the official mcp Python SDK or community examples have failed due to a lack of clear documentation and up-to-date, tested code.

Documentation here and here does not provide a step-by-step, runnable MCP server that can handle permission prompts in the way Claude Code expects.

Steps to Reproduce

  1. Try to create a minimal Python MCP server exposing a tool (e.g. mcp_auth_tool) that accepts a prompt and returns "allow"/"yes" or "deny"/"no".

  2. Start the server and run Claude Code with the flag:

    claude -p --permission-prompt-tool mcp_auth_tool "write a file"

  3. Observe that there are no working, end-to-end, documented examples in the official documentation or Python SDK for this flow.

Expected Behavior

There should be available a minimal, copy-pasteable, actually working example in the official documentation or SDK that demonstrates:

- How to implement a permission-prompt MCP tool in Python. 
- How to start the server (ideally with a shebang for `uv run` or similar).
- How to configure and invoke the Claude CLI to use the tool.
- That the example works out-of-the-box (e.g. with text file with regex rules or hardcoded regex rules) and is suitable for extension (e.g., for integrating with a security policy server).

Actual Behavior

  • No working minimal example is available in the docs or SDK.
  • Existing attempts (see https://github.com/CLIAI/mcp_permission_server_claude_code ) fail to establish a working connection, are out-of-date, or lack necessary configuration details.
  • This makes it difficult to extend Claude Code with organization-specific security or policy checks, and prevents adoption of the --permission-prompt-tool feature.

Additional Context

Related WIP repositories:

💡 Related repo/effort: for running Claude Code with --dangerously-skip-permissions in isolated (without internet except Claude servers) docker container: https://github.com/CLIAI/isolated-docker-claude-code

💡 Related repo/effort: MCP Permission server for Claude Code tools/commands Security Policies: https://github.com/CLIAI/mcp_permission_server_claude_code .

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:mcpdocumentationImprovements or additions to documentationenhancementNew feature or requestplatform:linuxIssue specifically occurs on Linux

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions