Skip to content
agentgateway has joined the Agentic AI Foundation — Learn more

For the complete documentation index, see llms.txt. Markdown versions of all docs pages are available by appending .md to any docs URL.

MCP servers

Verified : Code examples on this page have been automatically tested and verified.
Page as Markdown

Connect to an MCP server and try tools in the agentgateway playground.

Use the agentgateway binary to proxy requests to an open source MCP test server, server-everything. Then, try a tool in the built-in agentgateway playground.

Before you begin

  1. Install the agentgateway binary.

    Download and install the agentgateway binary. Alternatively, you can manually download the binary from the agentgateway releases page.

    To install the latest release:

    curl -sL https://agentgateway.dev/install | bash

    Example output:

      % Total    % Received % Xferd  Average Speed   Time    Time     Time     Current
                                     Dload  Upload   Total   Spent   Left    Speed
    100  8878  100  8878    0     0  68998      0 --:--:-- --:--:-- --:--:-- 69359
    
    Downloading https://github.com/agentgateway/agentgateway/releases/download/v1.6.0/agentgateway-darwin-arm64
    Verifying checksum... Done.
    Preparing to install agentgateway into /usr/local/bin
    Password:
    agentgateway installed into /usr/local/bin/agentgateway
    

Steps

Step 1: Start the MCP test server

Run the open source server-everything MCP test server with the streamable HTTP transport.

PORT=3005 npx -y @modelcontextprotocol/server-everything streamableHttp

Step 2: Configure agentgateway

You can add the MCP server in the UI, or write it in a configuration file.

Because you add the MCP server from the UI, you can start agentgateway without a config file. When you run agentgateway without specifying a config, it bootstraps a basic config at ~/.config/agentgateway/config.yaml and uses it automatically.

  1. Start agentgateway.

    agentgateway

    Example output:

    info  app  serving UI at http://localhost:4000/ui
  2. Open the agentgateway UI. The first time that you run the UI, the Welcome to Agentgateway wizard opens. Click Enable MCP, and then click Continue. If you already did this, skip to the next step.

    Welcome to Agentgateway dialog with Enable LLM, Enable MCP, and Traffic enabled options and a Continue button
    Welcome to Agentgateway dialog with Enable LLM, Enable MCP, and Traffic enabled options and a Continue button

    The Gateway Overview home page opens, with the MCP row enabled.

  3. Add the MCP server.

    1. In the MCP section of the navigation menu, click Servers, and then click Add server.
    2. For the Server name, enter server-everything.
    3. Keep the Streamable HTTP transport. For the URL, enter http://localhost:3005/mcp.
    4. Click Save server.
    Add MCP server drawer with the server name server-everything, the Streamable HTTP transport, and the URL http://localhost:3005/mcp
    Add MCP server drawer with the server name server-everything, the Streamable HTTP transport, and the URL http://localhost:3005/mcp

Step 3: Try a tool

You can try a tool in the UI playground or with curl. Both work the same way, whether you added the MCP server in the UI or in the config file.

  1. In the agentgateway UI, click Tool Playground in the MCP section.

  2. If you see a Browser access is not allowed notice, click Apply CORS so the playground can call the MCP listener from the UI.

  3. Click Initialize to open an MCP session. The playground lists the tools that the server exposes, such as echo and various get commands.

    MCP Playground with the echo tool selected and a list of 13 discovered tools in the Result panel
    MCP Playground with the echo tool selected and a list of 13 discovered tools in the Result panel
  4. From the Tool dropdown list, select the echo tool.

  5. In the Message field, enter a string, such as This is my first agentgateway setup, and click Call tool.

  6. Verify that the Result card shows an HTTP 200 response with your message echoed back.

    MCP Playground with the echo tool selected, a message entered, and the tool output Echo: This is my first agentgateway setup.
    MCP Playground with the echo tool selected, a message entered, and the tool output Echo: This is my first agentgateway setup.

Next steps

Check out more guides for using MCP servers with agentgateway.

Was this page helpful?
Agentgateway assistant

Ask me anything about agentgateway configuration, features, or usage.

Note: AI-generated content might contain errors; please verify and test all returned information.

Tip: one topic per conversation gives the best results. Use the + button in the chat header to start a new conversation.

Switching topics? Starting a new conversation improves accuracy.
↑↓ navigate ↵ select esc dismiss

What could be improved?

Your feedback helps us improve assistant answers and identify docs gaps we should fix.

Need more help? Join us on Discord: https://discord.gg/y9efgEmppm

Want to use your own agent? Add the Solo MCP server to query our docs directly. Get started here: https://search.solo.io/.