Archery MCP
Enables browsing MySQL instances, databases, and table schemas, running read-only SQL queries, and submitting or inspecting SQL release tickets through Archery.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Archery MCP
English | 简体中文
Wrap the everyday operations of the open-source SQL audit platform Archery into an MCP server: password login → browse instances / databases / tables → run read-only SQL → submit SQL release tickets → inspect tickets and audit results.
Pure Node.js, zero third-party dependencies — no Python required. Works with any MCP stdio client, such as Claude Desktop, Cursor, DeepSeek Harness or your own agent. The project does not modify Archery; it only calls Archery's existing HTTP APIs.
Features
Capability | Description |
Login | username/password login with Django CSRF and session handling; can reuse browser cookies for 2FA / SSO setups |
Instances & schema | list the instances you can access, plus databases and table schemas |
SQL queries | read-only whitelist by default (SELECT / SHOW / DESCRIBE / EXPLAIN); blocks writes, lock reads, file export and |
Ticket submission | creates real Archery SQL release tickets (enters the approval flow; never executes SQL directly) |
Ticket inspection | my tickets / tickets awaiting my review, details, SQL, automated audit results and operation logs |
Version support | auto-detects Archery 1.x (latest release v1.14: REST + page endpoints) and master (2.x dev: REST API) |
Archery 1.14 note: the
/api/v1/workflow*endpoints are gated byAPI_USER_WHITELIST. Before usingarchery_submit_workflow,archery_list_workflowsorarchery_get_workflow, ask an admin to add the account under System Settings → API_USER_WHITELIST, otherwise those calls return 403. Query, instance and schema endpoints are not affected.
Out of scope
Never executes tickets (no auto approve / execute / release), so an agent cannot accidentally touch production;
Never bypasses Archery's own permissions, query auditing, data masking or ticket workflow;
Ships no accounts, passwords or company addresses — everything comes from local configuration.
Related MCP server: Generic Database MCP Server
Quick start
Requirements: Node.js 18.3+. No npm install needed, no third-party dependencies.
cd archery-mcp
# copy and edit the configuration
cp config.example.json config.json # Windows: copy config.example.json config.json
node bin/archery-mcp.mjs --config config.json --check--check performs a real login and prints the detected flavor and the number of accessible instances:
{
"ok": true,
"settings": {
"base_url": "https://archery.example.com",
"username": "agent-bot",
"api_flavor": "auto",
"auth_mode": "password"
},
"flavor": "v1",
"instance_count": 12,
"instances": [
{ "id": 1, "instance_name": "prod-mysql", "db_type": "mysql" }
]
}Once the check passes, start the MCP server (stdio; normally launched by the client, so you rarely need to run it by hand):
node bin/archery-mcp.mjs --config config.jsonLocal testing (no real database)
The project ships a mock Archery (test/mock-archery.mjs) so you can exercise login, queries,
tickets and the MCP protocol without touching a production database.
node --test test/client.test.mjs test/mcp.test.mjs
# or
npm testAll 15 tests pass, covering:
password login, CSRF, session reuse and wrong passwords;
v1 query parameters, row limits and result truncation;
read-only validation (writes, multiple statements,
FOR UPDATE,OUTFILE,/*! */,LOAD_FILE);v1/v2 ticket submission, listing, details, audit results and logs;
the
API_USER_WHITELISThint when v1 ticket endpoints return 403;session-cookie mode;
MCP stdio protocol:
initialize,tools/list,tools/callsuccess and error paths;the
--checkself-test command.
The project has also been validated against a real Archery 1.x deployment: login, 24 instances,
database/table listing, table schemas, SELECT 1 / SHOW queries, ticket list (26k tickets) and
ticket details. Real ticket submission was never performed, to avoid creating approval requests;
whether table-level SELECT works depends on your Archery query permissions.
Connect an MCP client
Generic JSON config (Claude Desktop / Cursor, etc.)
{
"mcpServers": {
"archery": {
"command": "node",
"args": [
"C:\\path\\to\\archery-mcp\\bin\\archery-mcp.mjs",
"--config",
"C:\\path\\to\\archery-mcp\\config.json"
]
}
}
}Replace command with the real Node executable path (on Windows, avoid the Microsoft Store alias)
and point args at this project.
DeepSeek Harness (DSH)
dsh-bundle/ is a DSH bundle that only wires up the MCP connection. After installation, an
"Archery 数据库工单" connection appears in the plugin list and the 8 archery_* tools are registered
as mcp__archery__*. Before installing, update the Node path, script path and config path in
dsh-bundle/cordis.patch.yml, then run:
plugin_manager(action="install_bundle", target="C:\\path\\to\\archery-mcp\\dsh-bundle")After editing config.json, restart DSH (or reload the MCP connection), because configuration is
read at process start.
Installing the bundle writes to the current DSH profile and affects every session in that profile; double-check the paths before installing.
Environment variables (no config file)
export ARCHERY_BASE_URL="https://archery.example.com"
export ARCHERY_USERNAME="agent-bot"
export ARCHERY_PASSWORD="******"
node bin/archery-mcp.mjsPowerShell:
$env:ARCHERY_BASE_URL = "https://archery.example.com"
$env:ARCHERY_USERNAME = "agent-bot"
$env:ARCHERY_PASSWORD = "******"
node bin/archery-mcp.mjsEnvironment variables take precedence over the config file.
Configuration
Key | Env var | Default | Description |
|
| required | Archery site URL, e.g. |
|
| empty | login account |
|
| empty | login password |
|
| empty | browser |
|
| empty | browser |
|
|
| verify HTTPS certificates; set to |
|
|
| HTTP timeout in seconds |
|
|
|
|
|
|
| default query row limit |
|
|
| hard row limit for queries |
|
|
| preview rows returned to the model; extra rows are truncated and flagged |
|
|
| allow non-read-only SQL in the query tool; strongly discouraged |
Set the config path with --config or ARCHERY_MCP_CONFIG.
Tools
Tool | Purpose | Key parameters |
| list accessible instances |
|
| list databases on an instance |
|
| show a table schema |
|
| run read-only SQL |
|
| list resource groups you can submit to | — |
| create a SQL release ticket |
|
| ticket list / awaiting review |
|
| ticket details, SQL, audit results and logs |
|
Sample responses
Query:
{
"instance": "prod-mysql",
"database": "app_db",
"statement_count": 1,
"limit": 100,
"columns": ["id", "name"],
"row_count": 2,
"total_rows": 2,
"truncated": false,
"query_time": "0.012",
"is_masked": false,
"rows": [
{ "id": 1, "name": "alice" },
{ "id": 2, "name": "bob" }
]
}Ticket submission:
{
"workflow_id": 1234,
"audit_id": 5678,
"workflow_name": "add age column",
"instance": "prod-mysql",
"database": "app_db",
"group_id": 10,
"group_name": "DBA",
"status": "workflow_manreviewing",
"message": "submitted"
}Usage examples
Show me the 20 most recently registered users in app_db.users on prod-mysql,
only id, name and created_at.
Submit the following SQL as a ticket in the DBA group named "add index on orders":
ALTER TABLE orders ADD INDEX idx_user_id (user_id);
List the tickets awaiting my review, with the automated audit result for each.The model typically calls archery_list_instances / archery_list_databases to confirm the target
before querying or submitting.
Archery API compatibility
Archery versions expose different APIs; the client auto-detects the flavor, or you can pin it:
Action | Archery 1.x (v1.14) | Archery master (2.x dev) |
Login |
| same |
Instance list |
|
|
Databases / tables |
|
|
Query |
|
|
Submit ticket |
|
|
Ticket list |
|
|
Ticket details |
|
|
If your Archery version differs, set api_flavor first; if it is still incompatible, adjust the
paths and parameters in src/client.mjs.
2FA / SSO / CAS
With two-factor authentication or a unified login portal, username/password login does not yield a session. Workarounds:
Log in to Archery in your browser normally;
DevTools → Application → Cookies → copy
sessionid(andcsrftoken);Put them into the configuration:
{
"base_url": "https://archery.example.com",
"session_cookie": "xxxxxxxx",
"csrf_cookie": "yyyyyyyy",
"verify_tls": true
}Cookies expire, so this suits short-lived local use. For long-running setups, create a dedicated read-only/ticketing account for the agent with 2FA disabled, or provide a fixed session through your SSO gateway.
Security
Least privilege: create a dedicated Archery account for the agent, granting only the required instance
can_read/can_writetags and resource groups; query and ticket permissions are still enforced by Archery.Read-only first: the query tool rejects writes by default;
allow_write_sqlis for edge cases and is still bounded by the Archery account permissions.Writes:
archery_submit_workflowreally creates tickets and notifies approvers — verify the instance, database, name and SQL before calling it.Data exposure: query results enter the model context. Rely on Archery data masking for sensitive production fields, or limit the returned columns.
Credentials: prefer environment variables or a config file readable only by you; never commit
config.jsonor cookies to Git.TLS: certificates are verified by default; disabling verification should only happen on a controlled intranet.
Auditing: Archery records query and ticket operation logs; the MCP server itself only prints tool names and errors to stderr, never passwords or SQL.
The read-only SQL check is an extra guardrail, not a security boundary; the real boundary is the Archery account and the database account.
Project layout
archery-mcp/
├── bin/archery-mcp.mjs # CLI entry
├── src/
│ ├── config.mjs # JSON + env configuration
│ ├── http.mjs # stdlib HTTP client (Cookie/CSRF/gzip/TLS/redirects)
│ ├── client.mjs # Archery v1/v2 API wrapper
│ ├── sqlguard.mjs # read-only SQL validation and statement splitting
│ ├── tools.mjs # the 8 MCP tool definitions and handlers
│ ├── mcp.mjs # MCP stdio JSON-RPC server
│ └── cli.mjs # command-line entry
├── test/
│ ├── mock-archery.mjs # local Archery mock
│ ├── client.test.mjs
│ └── mcp.test.mjs
├── dsh-bundle/ # optional DSH MCP connection bundle
├── config.example.json
├── README.zh-CN.md
└── package.jsonRoadmap
Approve / execute ticket tools (closed by default; requires explicit confirmation and a separate switch);
Streamable HTTP transport and multi-tenancy (per-request account switching);
Generate tools automatically from Archery's Swagger (
/api/schema/) to reduce version adaptation work.
This server cannot be deployed
Maintenance
Related MCP Connectors
Read-only MCP access to sessions, funnels, campaigns, errors, live visitors, and anomalies.
Agent-native travel platform: read-only flight, hotel, and brand tools over MCP. OAuth sign-in.
Read-only MCP access to authorized Vocci sessions, notes, files, and memory search.
Read-only MCP access to a documented IT fleet: state, changes, posture. 15 tools.
Related MCP Servers
- AlicenseAqualityCmaintenanceA read-only MCP server for Archery that enables secure instance query, ticket management, and restricted SQL execution through AI clients.101MIT
- AlicenseNot gradedqualityDmaintenanceEnables read-only SQL querying and schema inspection across MSSQL, PostgreSQL, and MySQL databases via MCP tools.ISC
- AlicenseNot gradedqualityDmaintenanceEnables secure read-only queries and performance diagnostics for MySQL, Redis, and MongoDB databases through the Archery gateway, acting as a bridge between MCP clients and databases.MIT
- AlicenseNot gradedqualityBmaintenanceProvides a read-only SQL MCP server with guard rails including table visibility, column masking, row and time caps, and an audit trail, enabling safe database access for agents without granting full write permissions.MIT