# Addressing security and quality issues with MCP tools in AI Agent

By Steven Van · 2025-09-17

Vercel's new mcp-to-ai-sdk CLI turns MCP server tool definitions into version-controlled code instead of runtime-fetched prompts.

[Vercel](<https://creatorstoolbox.com/tools/vercel>) has released [mcp-to-ai-sdk](<https://vercel.com/blog/generate-static-ai-sdk-tools-from-mcp-servers-with-mcp-to-ai-sdk>), a CLI that generates static AI SDK tool definitions from any MCP server instead of pulling them in dynamically at runtime. The generated definitions land in your codebase as version-controlled files, so they only change when a developer updates them.

Vercel says dynamic MCP tool definitions create real risks: a compromised server can inject malicious prompts through tool names and descriptions, maintainers can add new capabilities (such as a delete function on a previously read-only server) without versioning, large servers can cost heavily in tokens (GitHub's MCP server uses around 50,000 tokens for its tool definitions alone), and renamed tools or vague descriptions can lower an agent's tool-call accuracy.

Running the CLI against a server's URL, for example *npx mcp-to-ai-sdk https://mcp.grep.app*, generates AI SDK-compatible tool files that still call the original MCP server at runtime, but with schemas and descriptions fixed in the repo. Developers can choose which tools to expose, edit descriptions to suit their model, restrict argument ranges, or add logic such as authentication.

[![](<https://assets.vercel.com/image/upload/contentful/image/e5382hct74si/1saSgF8yipfQemveOh1baN/f1302fc3fc07ef818d58391a55278071/mcp-to-ai-sdk_blog.jpg>)](<https://vercel.com/blog/generate-static-ai-sdk-tools-from-mcp-servers-with-mcp-to-ai-sdk>)

![Vercel](<https://www.google.com/s2/favicons?domain=vercel.com&sz=128>)

Vercel

The platform for frontend developers — deploy, preview, and scale web apps and AI agents with zero config.

[View Vercel →](<https://creatorstoolbox.com/tools/vercel>)

[Original source](<https://vercel.com/blog/generate-static-ai-sdk-tools-from-mcp-servers-with-mcp-to-ai-sdk>)

[Read Addressing security and quality issues with MCP tools in AI Agent on Creators Toolbox](<https://creatorstoolbox.com/blog/vercel-addressing-security-and-quality-issues-with-mcp-tools-in-ai-agent>)

---
Canonical source: https://creatorstoolbox.com/blog/vercel-addressing-security-and-quality-issues-with-mcp-tools-in-ai-agent
