Skip to main content
If you’re building your own AI agent, you can give it your Upsolve workspace as a tool. Your agent passes the data questions to the workspace’s analytics agent, and gets back the answer, the chart data and the SQL behind it. Each call runs as one of your users, with the same embed token your workspace embed already uses, so it sees only that user’s data. Your agent can only reach the end-user tools: ask the workspace’s agent questions and work with that user’s own conversations, favorites and canvases. It can’t reach any tools for building or changing a workspace.

Before you start

  1. A workspace with a production version. The endpoint only answers from the version promoted to production. See Environments.
  2. Embed tokens for your users. Your backend gets them from POST /v1/api/projects/embed-token, the same way it does for the workspace embed.

Connect

Each workspace has its own MCP endpoint, a standard Model Context Protocol server over Streamable HTTP. Copy its URL from Workspace settings → MCP Branding: The workspace is in the URL, so no tool asks your agent for an organization, project or workspace ID: the endpoint fills them in from the URL and the token. Any MCP client that can send its own Authorization header can connect. There’s no OAuth sign-in: the embed token is the sign-in. The token must be for a user of the workspace’s project, or the endpoint refuses it.

Example: Pydantic AI

This uses Pydantic AI 2.x. Each agent run gets that user’s embed token through deps, so one agent serves all your users:
The filter keeps your agent’s tool list short. Without it, your agent sees every end-user tool, which is fine too.

Your brand, not Upsolve’s

Set your name, icon and loading animation in MCP Branding. Everything your agent and your users see then uses them instead of Upsolve’s: the server’s name when a client connects, the tool descriptions and instructions your agent’s model reads, error messages, and the chart widget in Claude and ChatGPT. Without branding, the endpoint calls itself Analytics. When the agent builds a canvas for one of your users, the link it gives them opens your app, at the canvas link you set there. Your page then opens the canvas in your embed: see Open a canvas from a link.

Which tools to use

Use workspaces_chat_data, not workspaces_chat. They run the same turn, but workspaces_chat is built for clients like Claude that draw charts in the conversation. workspaces_chat_data returns plain content your agent can read. A workspaces_chat_data result has:
  • An access note that says whether row-level security narrowed the answer.
  • The answer, in markdown.
  • The charts: each chart’s config, its rows and the SQL that produced them.
  • The thread_id, for follow-ups.

Several workspaces

Each workspace has its own URL, so an agent that works with several connects to each one, or uses Upsolve’s end-user server, https://mcp.upsolve.ai/user, instead. That server takes the same embed tokens, but every tool needs the organization, project and workspace IDs, and its me_list, me_projects_list and me_workspaces_list tools let your agent find them. It isn’t branded.

Tokens

  • One token per user. Each call runs as the user the token was made for, under their data governance rules. Never share one user’s token with another.
  • Tokens expire. You choose how long a token lasts when you create it (5m to 7d). When it has expired, a tool fails with an error that says the embed token has expired, and you need a new token for the next run.
  • Keep it in your backend. Pass the token to your MCP client, as in the example, never to the model in its prompt.
  • Use embed tokens. Use tokens from POST /v1/api/projects/embed-token. The endpoint refuses Upsolve API keys and legacy tenant tokens.

Troubleshooting

The bearer isn’t an embed token. Send a token from POST /v1/api/projects/embed-token, not an Upsolve API key.
The token was made for another project, or for a user who belongs to another workspace. Check the workspace ID in the URL, and the project (and workspaceId, if you send one) you create the token for.
The request reached the server without a token. Check that your client sends Authorization: Bearer <embed token> on every request, as a header, and not through its OAuth settings.
The token has expired or isn’t valid. Get a new one from POST /v1/api/projects/embed-token and connect with it.
The endpoint only answers from the production version. Save a version of the workspace and promote it.
The answer is narrowed by the properties you sent when you created the token. Check the access note in the result, and the token’s properties against your data governance rules.

Next steps

MCP Branding

Your name, icon, loading animation and canvas links.

Embed Upsolve in your product

Get embed tokens for your users.