# MCP Agents

> Learn how to scale the number of MCP servers with agents.

[Your browser does not support the audio element.](https://microsoft.github.io/genaiscript/llms-full.txt.mp3 "Generated by 🤖 AI with random voice personality. Content interpretation may vary.")

Generated by 🤖 AI

We’ve added support to configure MCP servers in the script metadata and wrap them with agents. As a result, you can now run multiple MCP servers in parallel, each with its own agent.

```js
script({
  title: "Wraps the playwright MCP server with an agent.",
  mcpAgentServers: {
    playwright: {
      description:
        "An agent that uses playwright to run browser commands.",
      command: "npx",
      args: ["--yes", "@playwright/mcp@latest", "--headless"],
      instructions:
        "Use the playwright tools as the Browser Automation Tools.",
    },
  },
});


$`Extract the OpenAI pricing from https://azure.microsoft.com/en-us/pricing/details/cognitive-services/openai-service/`;
```

## Just want servers?

[Section titled “Just want servers?”](#just-want-servers)

Don’t want to go through the agent abstraction? You can also inject the MCP server directly in the prompt using the `mcpServers` field.

mcpServers

```js
script({
  title: "Uses playwright MCP tools.",
  mcpServers: {
    playwright: {
      command: "npx",
      args: ["--yes", "@playwright/mcp@latest", "--headless"],
    },
  },
});


$`Extract the OpenAI pricing from https://azure.microsoft.com/en-us/pricing/details/cognitive-services/openai-service/`;
```