oceanbase / oceanbase/powercontext

bug: authenticated Codex MCP probe fails on /mcp URL redirect

Open
#1,661 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
1.1k
Forks
214
Avg merge
1d 11h
Merged PRs (30d)
199

Description

Describe the bug

The Codex MCP integration fails to discover the PowerContext tools when the configured Streamable HTTP URL is http://127.0.0.1:8000/mcp and the Server requires Bearer authentication. The canonical endpoint with a trailing slash, http://127.0.0.1:8000/mcp/, works correctly.

The failure is especially confusing because authorization itself can be configured correctly, while the native MCP probe still reports that remember_memory and search_memory are unavailable.

Steps to reproduce
  1. Run PowerContext Server on Windows with enforced Bearer authentication and MCP enabled.
  2. Configure the Codex integration with:
    http://127.0.0.1:8000/mcp
  3. Set POWERCONTEXT_CODEX_AUTHORIZATION to a valid Bearer <token> value.
  4. Restart Codex and run powercontext doctor codex.
  5. Observe that authorization is reported as configured, but required MCP tools are not discovered.
  6. Connect directly to http://127.0.0.1:8000/mcp/ and perform the MCP initialize and tools/list requests with the same credential.
Expected behavior

The generated Codex MCP configuration should use the canonical endpoint, or the Server/client combination should handle /mcp and /mcp/ equivalently while preserving the Authorization header. The native Codex probe should discover the PowerContext tools.

Actual behavior

The /mcp request is redirected to /mcp/. In the affected client path, the redirected request does not preserve the Authorization header and returns 401 Unauthorized. Using /mcp/ directly succeeds: MCP initialization completes and tools/list returns the expected tools, including remember_memory and search_memory.

Observed diagnostic state:

authorization: ok
current_process: configured
mcp tools: failed - Codex native MCP did not discover required tools: remember_memory, search_memory
Environment
  • PowerContext: 3.4.4
  • OS: Windows
  • Transport: Streamable HTTP
  • Server URL configured by the Codex integration: http://127.0.0.1:8000/mcp
  • Working endpoint: http://127.0.0.1:8000/mcp/
Are you willing to submit a PR to fix this bug?
  • Yes, I would like to submit a PR.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Codex integration that generates the MCP configuration and the code behind powercontext doctor codex; reproduce the probe using /mcp and /mcp/ with Bearer authentication. Done means the configured endpoint works through the redirect or uses the canonical trailing-slash URL, preserves authorization, and discovers remember_memory and search_memory.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.