Skip to content

fix: allow read-only CALL queries in axon_cypher#47

Closed
bhattaraiprayag wants to merge 3 commits intoharshkedia177:mainfrom
bhattaraiprayag:fix/cypher-call-block
Closed

fix: allow read-only CALL queries in axon_cypher#47
bhattaraiprayag wants to merge 3 commits intoharshkedia177:mainfrom
bhattaraiprayag:fix/cypher-call-block

Conversation

@bhattaraiprayag
Copy link
Copy Markdown

@bhattaraiprayag bhattaraiprayag commented Mar 4, 2026

Why

axon_cypher currently rejects any query containing CALL, which blocks legitimate read-only procedure calls (for example CALL QUERY_FTS_INDEX(...)).

Scope

This PR makes one focused bug fix to axon_cypher read-only query gating and adds regression tests for that exact behavior.

What changed

  • Updated src/axon/mcp/tools.py:
    • removed CALL from the write/admin keyword deny-list
    • kept write/admin keywords blocked (DELETE, DROP, CREATE, SET, REMOVE, MERGE, DETACH, INSTALL, LOAD, COPY)
    • clarified rejection text for disallowed operations
  • Added regression tests in tests/mcp/test_tools.py:
    • allows read-only CALL QUERY_FTS_INDEX(...)
    • blocks CALL INSTALL ...
    • blocks CALL LOAD ...
    • blocks write-operation query (DETACH DELETE)

Validation

  • uv run pytest -q tests/mcp/test_tools.py -> 48 passed
  • uv run pytest -q -> 588 passed
  • Runtime verification on sample repos:
    • axon analyze --no-embeddings succeeds for python/javascript/typescript
    • axon cypher "CALL QUERY_FTS_INDEX(...)" now returns results
    • axon cypher "CALL INSTALL EXTENSION fts" is still rejected

Closes #36

Checklist

  • This PR is linked to a maintainer-approved issue (or is a trivial typo/link fix under 5 lines)
  • I have read CONTRIBUTING.md
  • One logical change only — no bundled/unrelated work
  • Tests added or updated for this change
  • pytest passes locally
  • ruff check src/ tests/ passes
  • I can explain every line of this PR when asked
  • No generated project-config files (CLAUDE.md, .cursorrules, etc.)

- Remove CALL from the cypher write/admin deny-list so read-only procedures such as QUERY_FTS_INDEX can be executed through axon_cypher. Keep unsafe operations blocked via existing write/admin keywords including INSTALL and LOAD.

- Add regression tests for allowed read-only CALL usage and blocked unsafe CALL and write-operation queries.
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.

CALL keyword blocked in axon_cypher prevents legitimate stored procedure queries

1 participant