Skip to content

Surface AskBill sources in search_documentation MCP tool#29

Merged
phoenixy1 merged 3 commits into
mainfrom
ah-mcp-surface-doc-sources
May 5, 2026
Merged

Surface AskBill sources in search_documentation MCP tool#29
phoenixy1 merged 3 commits into
mainfrom
ah-mcp-surface-doc-sources

Conversation

@phoenixy1
Copy link
Copy Markdown
Contributor

@phoenixy1 phoenixy1 commented May 5, 2026

The "Add to Cursor" button in sandbox/README.md was silently failing because the base64-encoded config used the wrong shape.

Decoded before:

{"command":"uvx mcp-server-plaid","env":{"PLAID_CLIENT_ID":"ADD_YOUR_CLIENT_ID","PLAID_SECRET":"ADD_YOUR_API_SECRET"}}

Decoded after:

{"command":"uvx","args":["mcp-server-plaid"],"env":{"PLAID_CLIENT_ID":"ADD_YOUR_CLIENT_ID","PLAID_SECRET":"ADD_YOUR_API_SECRET"}}

Cursor's install-mcp link expects command to be just the executable, with arguments in a separate args array (same shape as mcp.json). Concatenating them into the command string makes Cursor try to spawn "uvx mcp-server-plaid" as a single binary, which fails.

Refs: https://cursor.com/docs/context/mcp/install-links

Test plan

  • Click the badge on the rendered README and confirm Cursor opens the install dialog with the correct command/args populated
  • After install, replace the ADD_YOUR_* placeholders and verify the server starts

🤖 Generated with Claude Code

Claude Session: 80ee54fa-3880-4c3c-b81d-9bf74c3adb2c

phoenixy1 and others added 3 commits May 5, 2026 16:12
The AskBill websocket service returns both `answer` and `sources`, but the
handler was only forwarding `answer`. Without citations, callers (and the
LLMs consuming this tool) have no way to verify URLs the answer text mentions
— in practice, hallucinated links slip through unchallenged.

Append a `## Sources` section to the response, formatted from the
`SourceMetadata` shape (title, url) defined in finn-mvp.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…g whitespace

- Escape `\`, `[`, `]` in source titles so titles like "Auth [v2]" don't
  break the rendered markdown link.
- Wrap URLs in angle brackets (`<url>`) so URLs containing parens (e.g.
  Wikipedia's `Plaid_(company)`) still render correctly.
- `rstrip()` the answer before appending the Sources section so trailing
  newlines in the AskBill response don't produce 3+ blank lines.
- Add a docstring to `_format_sources` to match the rest of the file.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The `[tool.pytest]` section was non-canonical (should be
`[tool.pytest.ini_options]`) and `python_files` was a bare string instead
of a list. Older pytest tolerated both; newer pytest (9.x) hard-fails:

  TypeError: pyproject.toml: config option 'python_files' expects a
  list for type 'args', got str: 'test_*.py'

Last green CI run was October 2025 against pytest 8.x; this PR is the
first run since pytest 9 made it into the environment.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@phoenixy1 phoenixy1 marked this pull request as ready for review May 5, 2026 23:48
@phoenixy1 phoenixy1 merged commit 0369426 into main May 5, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant