Getting Started with MCP Gateway - Agent
MCP Gateway tutorialLocal with an AI agent
Connect an MCP client to Linear through your own gateway and call a Linear tool.
Follow along using
Have a coding agent build a local MCP Gateway in front of Linear. You'll complete the browser authorization yourself and verify a real Linear tool call.
Prerequisites
- Node.js 24 or later.
- A Zuplo account.
- An installed coding agent and a Linear account with access to a workspace.
- An MCP client that can connect to a local HTTP server and complete OAuth.
This tutorial uses Zuplo's local dev-login shortcut. For a hosted gateway with
your identity provider, use the Portal tutorial.
Build your MCP Gateway with an agent
-
Create your project
Run:
CodeWhen prompted, choose Yes to create a matching Portal project, complete sign-in, and select your Zuplo account. Select the coding agent you use when asked. The CLI creates and links the hosted project. See
create-zuplo-api.Zuplo skills
The scaffold installs Zuplo skills in this project for Codex and Cursor and configures the Claude Code plugin. If setup fails, follow Agent Skills from this directory before starting your agent.
-
Give the agent the gateway configuration task
Open your agent in the project directory and use this prompt:
CodeThe Editor tutorial shows these files as copyable examples. See How it works for the gateway's sign-in and upstream authorization flows.
-
Verify authentication is attached
Review the diff, then run
npm run devif it isn't already running. In another terminal, send:CodeExpect
401 Unauthorizedand aWWW-Authenticateheader pointing to/.well-known/oauth-protected-resource/mcp/linear-v1. A404suggests a route mismatch; for a500, inspect the gateway's terminal output. -
Add
http://127.0.0.1:9000/mcp/linear-v1as an HTTP MCP server in your client. See Connect MCP clients for client-specific setup.Keep
127.0.0.1in the client URL to match the policy. During the browser OAuth flow, dev-login signs you in locally. On the gateway's consent page, click Connect for Linear, authorize your Linear account, then click Authorize to complete the gateway connection.Complete these actions yourself; the coding agent doesn't need your Linear password or tokens.
-
Run a real tool
Ask your client to
List my open Linear issues. Approve the tool call. Check that it returns your issues, or an empty result if you have none, without an authentication error.If connection fails, check that the local server is running and the client uses
127.0.0.1throughout. See Local development.
Deploy with your identity provider
Dev-login works only on loopback origins. Before sharing the gateway, replace it with your identity provider using Configure local and deployed environments, then follow Deploy to the edge. Repeat the full browser authorization and tool call against the hosted URL.