Skip to content

LearnAI and LLM

MCP server and agent trust review

Brief

Every MCP server an AI client connects to is code and text the model trusts: a local process with the user's credentials, or a remote service whose tool descriptions the model reads as instructions on every turn. The review lists each server, how it authenticates, what it exposes, how its version is fixed and who can change the configuration, and records the trust boundary each one crosses.

Stage
Access
Reviewed
On this page
  1. Check first
  2. Which MCP servers is the client configured to reach?
  3. How does each server authenticate, and with what?
  4. What does each server expose, and does the user see it?
  5. How are versions pinned, and who can change the configuration?
  6. What does a tester record about trust boundaries?
  7. The defender sees
  8. Done when
  9. Not covered
  10. Tools
  11. Related research
  12. Reviewed

All commands

Situation
The MCP configuration files from the client's developer workstation image, agent hosts and repositories, read access to the servers' packages or images, and a test credential for each remote server, all shared for the test. We read configuration and call only initialize and tools/list, never a tool, and we print environment variable names, never values. Only the clients, servers and repositories the scope letter names are reviewed.
Goal
A server table: each MCP server with its transport, operator, credential and scope, tools that write, version pinning, who can change its configuration, and the boundaries between servers and agents.
Outputs
Representative examples on placeholder hosts, trimmed to the lines that matter. Not captured from a public fixture yet.

Check first

  • Every place configuration can live: project files such as .mcp.json, .cursor/mcp.json and .vscode/mcp.json, and user files such as ~/.claude.json, ~/.cursor/mcp.json and the Claude Desktop config under ~/Library/Application Support/Claude/.
  • Which servers the client approved, and who operates each remote one.
  • Whether the client's AI tools let administrators set an allowlist of servers.
  • Which agents call other agents, and with what credential.
  • Where tool calls are logged, on the client side and on each server.

Steps

Which MCP servers is the client configured to reach?

for f in .mcp.json .cursor/mcp.json .vscode/mcp.json; do
  [ -f "$f" ] && jq -r --arg f "$f" '(.mcpServers // .servers) | to_entries[] | [$f, .key,
    (.value.type // (if .value.url then "http" else "stdio" end)),
    ([(.value.env // {}) | keys[]] | if length == 0 then "-" else join(",") end),
    (.value.url // ([.value.command] + (.value.args // []) | join(" ")))] | @tsv' "$f"
done

Expected output

.mcp.json	github	stdio	GITHUB_TOKEN	npx -y @example/mcp-github   # <- no version: npx runs whatever is latest at each start
.mcp.json	crm	http	-	https://mcp.crm.example.com/mcp
.vscode/mcp.json	files	stdio	-	npx -y @example/mcp-files@1.4.2

A stdio server is a local process started by the client with the user's rights and whatever is in its environment. An http server is someone else's service. We run the same read over each user-level file and record variable names only; a token written into the file as a value is a finding by itself.

Negative result. Only approved servers, each from a known publisher, with credentials drawn from a secret store or an OAuth sign-in instead of the file.

Fix. Keep an approved server list, enforce it with the client's managed settings where it has them, and move tokens out of config files.

How does each server authenticate, and with what?

curl -s -o /dev/null -w '%{http_code}\n' -X POST https://mcp.crm.example.com/mcp \
  -H 'Content-Type: application/json' -H 'Accept: application/json, text/event-stream' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
curl -sI -H "Authorization: Bearer $GITHUB_TOKEN" https://api.github.com/user | grep -i '^x-oauth-scopes'

Expected output

200   # <- the CRM server answered with no credential at all
x-oauth-scopes: repo, workflow, admin:org

A remote server should refuse an unauthenticated request with 401 and point to its OAuth metadata at /.well-known/oauth-protected-resource. For local servers the credential is whatever the environment holds, so its scope is the server's reach. GitHub returns a classic token's scopes in a header, and here a token that can administer the GitHub organization sits behind a server the developer uses to read issues. The client's engineer runs the second line with the token already in the shell, so the value is never printed.

Negative result. 401 from every remote server without a token, and each local server's token scoped to the repositories and actions its tools need.

Fix. Require OAuth on remote servers with tokens issued for that server only, and give local servers fine-grained tokens with the smallest scope and a short life.

What does each server expose, and does the user see it?

curl -s -X POST https://mcp.crm.example.com/mcp -H "Authorization: Bearer $CRM_TEST_TOKEN" \
  -H "Mcp-Session-Id: $SID" -H 'Content-Type: application/json' -H 'Accept: application/json' \
  -d '{"jsonrpc":"2.0","id":2,"method":"tools/list"}' \
  | jq -r '.result.tools[] | [.name, (.annotations.readOnlyHint // false), (.description | length)] | @tsv'

Expected output

search_accounts	true	96
export_accounts	false	2140   # <- a 2,140-character description the model reads on every turn
delete_account	false	88

The session id comes from an initialize call with our test credential. A tool description is text the model treats as guidance, so a long one deserves a full read for instructions that reach beyond the tool, and the tool list can change after the user approved it. Annotations such as readOnlyHint are claims by the server, not controls. In the client we then check whether the approval prompt shows the full description, and whether a changed tool list is announced.

Negative result. Short descriptions that describe only the tool, write tools marked as such, and a client that shows descriptions and asks again when they change.

Fix. Review descriptions when a server is approved and on every update, disable tools nobody uses, and require a confirmation for every write tool regardless of its annotations.

How are versions pinned, and who can change the configuration?

git log --format='%h %ad %s' --date=short -- .mcp.json .vscode/mcp.json
grep -E 'mcp' .github/CODEOWNERS || echo 'no owner for MCP config'

Expected output

4e5f6a7 2026-10-02 Add CRM MCP server
a1b2c3d 2026-09-14 Add GitHub MCP server
no owner for MCP config   # <- any merged change can add a server every developer's client starts

An unpinned package runs whatever its publisher, or whoever took over the publisher's account, released last. A project file added to a repository reaches every developer who opens it; some clients ask before starting project servers and some do not. A remote server can change at any time, so its pin is the trust placed in its operator.

Negative result. Exact versions or image digests for every local server, a code owner for each config file, and clients that ask before starting a project server.

Fix. Pin versions and digests, update them through reviewed changes, and add the config files to CODEOWNERS with the security team as owner.

What does a tester record about trust boundaries?

server     operator     transport  credential and scope         writes  pinned  shown  config owner
github     publisher    stdio      PAT: repo, workflow, admin   yes     no      no     none
crm        crm vendor   http       none required                yes     n/a     no     none
files      in-house     stdio      user's own file rights       yes     1.4.2   yes    platform

One row per server. The boundary that matters most is between servers: text returned by a read tool on one server lands in the same context as the write tools of another, so a CRM record can steer the GitHub server. Where agents call agents, we record the credential each hop carries and whether the second agent treats the first one's request as the user's.

Negative result. Every row has an owner, a pin and a scoped credential, and no agent hop forwards a token it received.

Fix. Split servers with write tools into separate agent sessions from servers that return outside text, and never pass a user's token through to another server.

The defender sees

Process creation on developer machines shows npx or uvx starting each local server, with the package name, if endpoint logging captures command lines. Remote servers log initialize and tools/list from our test credential, and the unauthenticated request should appear as a refused call. GitHub's audit log shows what the token changes in the organization. The persistence review covers what these connections keep after a conversation ends. If the client cannot list which servers run on its laptops, that inventory gap is the first finding.

Done when

Every configured server is listed from every config location, each has its authentication and credential scope recorded, each remote server's tools are listed with their annotations and description lengths, each server's pin state is known, and the owners of each config file are named by team.

Not covered

Whether a tool can be driven by injected text (see prompt injection testing), what each tool can change (see the tool permission review), and the servers' own code security; the outputs shown are representative examples on placeholder hosts, not captured runs.