Swap a heavy MCP server for a script your agent calls
If your coding agent makes 3 calls to your issue tracker, give it a short shell script with those 3 calls instead of the tracker’s MCP server. It returns only the fields the agent needs. It can only make the writes you put in it. And you can run it yourself to see what the agent saw.
What the server cost
An MCP server hands the agent every tool it has. Say your tracker’s server has search, create, update, delete, comment, attach, link, list projects and list users. A flow that ships one ticket needs 3 of those: read the ticket, comment on it, move it to the next status.
Claude Code already softens part of that. Its MCP docs say “Tool search is enabled by default: MCP tools are deferred and discovered on demand”, so only tool names load at session start. A client without tool search loads every definition up front.
Responses cost more than the tool list. Reading a ticket through a server like that returns the whole object: description, every comment, the history, labels, attachments, people. Claude Code warns when an MCP tool result passes 10,000 tokens and cuts it at 25,000 by default. The agent reads all of it to find a title, a status and the acceptance criteria.
Writes are the real risk. The server offers delete and reassign, so the agent can call them. You can deny those by name in permissions (mcp__tracker__delete_issue and so on) or approve tools one at a time. Either way you’re tracking somebody else’s tool list. And if you got tired of prompts and allowed the whole server (mcp__tracker), every tool they add later comes with it.
The script
The tracker and its API below are made up. The shape is the one I use. Save it as scripts/tracker.sh:
#!/usr/bin/env bash
# tracker.sh: the only tracker calls the agent may make.
# usage: tracker.sh get <id> | comment <id> <file> | move <id> <status>
set -euo pipefail
API="https://tracker.example.com/api/v1"
auth=(-H "Authorization: Bearer ${TRACKER_TOKEN:?TRACKER_TOKEN is not set}")
case "${1:-}" in
get)
curl -fsS "${auth[@]}" "$API/issues/$2" |
jq '{id, title, status, acceptance: .fields.acceptance_criteria}'
;;
comment)
jq -Rs '{body: .}' "$3" |
curl -fsS "${auth[@]}" -H "Content-Type: application/json" \
--data @- "$API/issues/$2/comments" >/dev/null
echo "commented on $2"
;;
move)
case "$3" in
in_review|ready_for_qa) ;;
*) echo "refused: the agent may only move a ticket to in_review or ready_for_qa" >&2; exit 2 ;;
esac
jq -n --arg s "$3" '{status: $s}' |
curl -fsS "${auth[@]}" -X PATCH -H "Content-Type: application/json" \
--data @- "$API/issues/$2" >/dev/null
echo "moved $2 to $3"
;;
*)
echo "usage: tracker.sh get <id> | comment <id> <file> | move <id> <status>" >&2
exit 2
;;
esac
get pipes the response through jq and keeps 4 fields. The agent never sees the comments or the history.
comment takes a file, never an inline string. Agents write long markdown summaries full of backticks and quotes, and a file means no shell quoting fights. The agent writes the summary with its normal file tool, then passes the path.
move has an allow list of statuses. The agent can hand a ticket to review or QA. It can’t close it, and it can’t push it back to the backlog to make a failing task disappear.
Anything else falls through to the usage line and exit code 2. There’s no delete command at all.
Here’s what the agent gets back for a made-up ticket:
$ scripts/tracker.sh get ABC-142
{
"id": "ABC-142",
"title": "Export ignores the date filter",
"status": "ready",
"acceptance": "The CSV export only includes rows inside the selected date range"
}
Wire it in
Name the script in the command file the agent runs, so it doesn’t go looking for another way:
## Tracker
Use `scripts/tracker.sh` for every tracker call. Read the ticket with `get` before you plan.
When the PR is open, write your summary to a file, `comment` it, then `move` the ticket to `in_review`.
Then allow exactly those calls in .claude/settings.json, so the agent runs them without asking:
{
"permissions": {
"allow": [
"Bash(scripts/tracker.sh get:*)",
"Bash(scripts/tracker.sh comment:*)",
"Bash(scripts/tracker.sh move:*)"
]
}
}
An allow list approves calls. It doesn’t fence anything off. The token sits in the agent’s environment, so an agent with unrestricted Bash could still curl the API itself. Keep plain Bash on ask, so a raw call to the tracker stops and waits for you. For unattended runs that’s a sandbox’s job, and this script doesn’t replace one.
Last step, take the tracker server out of the project’s .mcp.json. If the server stays in .mcp.json, the agent can still reach for it, and then it’s back to full tickets and a delete tool.
What the swap buys you
You stop keeping a deny list in step with someone else’s server.
Debugging gets easier. When a run does something odd with a ticket, copy the exact line from the transcript into your terminal and you get the same output the agent got. You don’t need the MCP client or a hand-built tool call for it.
And the script lives in the repo. If the agent needs a new tracker call, someone adds it in a PR and someone else reviews it.
When I’d keep the MCP server
- The agent needs many calls, or calls you can’t predict. Exploring a tracker it hasn’t seen, or pulling a report across projects, is what a full tool list is for.
- The server handles auth you don’t want to rebuild, like per-user OAuth with refresh tokens.
- Several clients share one server: Claude Code, your IDE and a chat app all reading the same tracker.
- You want the vendor’s new tools the day they ship, without touching your repo.