# MCP explained: give your agent tools, not your keys

- Author: RomanMotion (https://wurk.fun/user/RomanMotion)
- Published: 2026-10-30
- Updated: 2026-11-03
- Canonical (HTML): https://wurk.fun/blog/mcp-explained-give-your-agent-tools-not-your-keys
- Cover image: https://ik.imagekit.io/wurk/browser-uploads/f1c626b5c17e7f0a61dfbbe7a20d85ae7b33a20527243aeec2ee1d0a8b87562a/781921a7-6ab2-4112-9f05-659af609f7d6/cover-F5.jpg?wurkUpload=v1.wA2Fi5QQ9Fbfa3pMa3zb0mL-ToLLfjXJPA_tYWZMhGU

---

You're building with an AI agent that needs access to the things you actually work on: your repos, your data, your files. Hand it those credentials directly and one prompt-injected tool result turns your agent into the breach. MCP lets you grant capability without giving up keys, and you can set it up the safe way in about ten minutes.

Model Context Protocol (MCP) is an open standard for connecting AI applications to external tools and data ([modelcontextprotocol.io](https://modelcontextprotocol.io)). Instead of pasting a token into a chat, you run a small MCP server that holds the credentials, exposes exactly the tools you approve, and talks to your agent's host app. The agent never sees the key. It sees the tools.

## How the pieces fit

Three parts, and knowing them tells you where the risk lives.

The server is the worker. It exposes tools (actions the agent can call, like read_file or list_commits) and resources (data it can serve up, like a file tree or a query result). The credentials live here.

The host is the connector. Your agent's app, whether that's an editor or an agent harness, connects to one or more servers and offers their tools to the agent.

The agent is the decision maker. It picks which tool to call based on your instructions and whatever the tools return.

Four server types cover most freelance and bounty work:

- A filesystem server scoped to one project folder, so the agent can read the codebase without touching the rest of your disk.
- A git server for commits, branches and diffs, so you stop copy-pasting patches by hand.
- A database server pointed at a read-only connection, so the agent pulls real numbers instead of guessing at them.
- A browser automation server, for checking a deployed page or reading a site you don't control.

## Start read-only, one server per job

Two rules do most of the protective work.

Start read-only. Connect a server that can only read (files, git log, SELECT queries) and use it for a week. You learn what the agent actually reaches for before you grant anything it can change. When you add write access, add it to one server, one scope.

One server per job. A filesystem server for the project, a git server for version control, a database server for reads. If one server misbehaves or gets compromised, you know exactly which capability to cut, and cutting it doesn't take your whole setup down with it.

## Scope every credential

The server holds your keys so the chat doesn't have to, but the server is only as safe as the credentials you give it. Scope each one to the least permission that works: a database user with SELECT only, a git token with read access to one repo, a filesystem server pointed at one folder instead of your home directory. Reissuing a scoped token costs minutes. Rotating after a full-access key leaks costs days.

And never paste a key into the conversation itself. Anything in the chat sits in the model's context, which means it can be quoted back, logged, or end up inside a tool call's arguments. Keys go in the server's config file on your machine, nowhere else.

## Vet a server before you install it

Installing a third-party MCP server means running someone else's code with your credentials attached. Before you add one, read its tool list and ask what you'd be granting. Prefer servers whose source you can inspect, or ones published by the maintainers of the thing they connect to. Check what permissions it asks for and whether they match what it actually does.

Then there's prompt injection. Tool results are untrusted input: a web page your browser server reads, or an issue title your git server fetches, can contain text written to steer your agent into calling the wrong tool with the wrong arguments. The MCP spec says clients must treat tool annotations as untrusted unless they come from trusted servers, and that a human should always be able to deny a tool call ([MCP spec: tools](https://modelcontextprotocol.io/specification/2025-06-18/server/tools)). Its [security best practices](https://modelcontextprotocol.io/specification/2025-06-18/basic/security_best_practices) page is worth five minutes before you wire anything in. Practical defense: keep write-capable servers on a short leash, and review the actual tool calls before they run on anything that matters.

## Your 10-minute setup

A first server you can do start to finish in ten minutes:

1. Pick one job. "Let the agent read the repo it's working on" is a good first one.
2. Pick the narrowest server for that job, ideally a read-only one.
3. Mint scoped credentials: a read-only database user, or a git token with read on one repo.
4. Put the credentials in the server's config file on your machine. Not in chat, not in a shared doc.
5. Connect the server in your agent's host app and list its tools. You should see a handful of reads, nothing more.
6. Run one harmless call (list the files, show a diff) and watch what comes back.

That's the whole loop. Every server after this one repeats it, and step 2 is where the discipline lives: narrowest tool for the job.

## The checklist before any new server

Screenshot this:

- What job does this server do that my current ones don't?
- Is there a read-only mode or a read-only variant?
- What credentials does it need, and what's the least permission that works?
- Where do those credentials go? (Config file on my machine, never chat.)
- Who publishes it, and can I read the source or the changelog?
- What do its tool results touch, and could any carry injected instructions?
- Can I remove it cleanly when I'm done with it?

If you can't answer one of these, the server waits. We keep more guides like this on [our blog](https://jackgross-five.vercel.app).

## Where a harness like ZCode fits

The host side matters as much as the servers: it decides which tools the agent may call without asking. ZCode is one such host, a desktop app for vibe coding on complex goals with multiple agents; its Goals feature manages long-running work with continuous planning, execution and verification, and you can start and steer it from Telegram, WeChat or Feishu ([zcode.z.ai](https://zcode.z.ai/en)). Run the same read-only-first checklist on it. You can [try the ZCode agent harness free with our invite link](https://zcode.z.ai/invite/ALWM9JUA).

It pairs with the GLM Coding Plan, one subscription that powers agent coding tools including ZCode, in Lite, Pro and Max tiers ([docs](https://docs.z.ai/devpack/overview)). Prices and allowances change, so check the current numbers there, and grab [a referral discount on GLM coding plans with our referral link](https://z.ai/subscribe?ic=R0K78RJKNW). Both Z.ai links are ours.

Next step: read [how to run an AI agent on WURK without leaking its keys](https://wurk.fun/blog/run-an-ai-agent-on-wurk-without-leaking-its-keys). If this saved you an hour, a small tip on this post keeps these guides coming.
