MCP Integration
AgentMark supports calling Model Context Protocol (MCP) tools directly from your prompts.What is MCP?
The Model Context Protocol (MCP) is an open standard that allows AI applications to connect to external tools and data sources. Instead of hardcoding tool implementations, MCP lets you:- Connect to tool servers — Use pre-built MCP servers for filesystems, databases, APIs, and more
- Standardize tool interfaces — All MCP tools follow the same protocol, making them interchangeable
- Share tools across projects — One MCP server can serve multiple AI applications
Think of MCP like USB for AI tools. Just as USB provides a standard way to connect peripherals to computers, MCP provides a standard way to connect tools to AI applications.
How MCP works with AgentMark
- You configure MCP servers in your AgentMark client (either a local process or a remote URL)
- You reference MCP tools in your prompt frontmatter using
mcp://{server}/{tool}syntax - At runtime, AgentMark connects to the server and makes those tools available to the AI model
What you’ll learn
- Configure MCP servers (local process or remote URL)
- Reference MCP tools in prompts using
mcp://URIs - Combine MCP tools with inline tool definitions
- Use environment variable interpolation for secrets
MCP Server Types
AgentMark supports two types of MCP servers:| Type | Use Case | Configuration |
|---|---|---|
| stdio | Local tools that run as a subprocess | command, args, cwd, env |
| URL/SSE | Remote tools accessed over HTTP | url, headers |
stdio servers (local process)
The server runs as a child process on your machine. AgentMark communicates with it via stdin/stdout.URL servers (remote HTTP)
The server runs remotely and accepts requests over HTTP with Server-Sent Events (SSE).1) Configure MCP servers
Define servers when creating your AgentMark client. You can mix both server types. Useenv("VAR_NAME") to interpolate environment variables anywhere in the config — this keeps secrets out of your code.
- URL servers accept only
url(and adapter-allowedheaders). - stdio servers accept only
command,args,cwd,env.
Environment interpolation
Useenv("VAR") anywhere in the config; values resolve from process.env.VAR:
2) Reference MCP tools in prompts
Declare MCP tools in your prompt frontmatter. You can mix MCP tools with inline tool definitions.mcp-example.prompt.mdx
search_docsresolves to the MCP serverdocs, toolweb-search.summarizeis an inline tool available via the adapter tool registry.
Wildcard: include all tools from a server
Include every tool exported by a server using*:
- The alias key (
all) is ignored; server tools are added by their original names. - If a tool name collides with an existing inline tool, the later-added tool overwrites the earlier one.
3) Format and run (AI SDK example)
Notes and best practices
- Keep server configs minimal to pass type guards.
- Prefer environment interpolation for portability and secrets hygiene.
- Use wildcard import to quickly expose a server’s full tool surface; be mindful of name collisions.
Have Questions?
We’re here to help! Choose the best way to reach us:
- Join our Discord community for quick answers and discussions
- Email us at hello@agentmark.co for support
- Schedule an Enterprise Demo to learn about our business solutions