Call MCP Server
The Model Context Protocol (MCP) is an open standard that lets your agent discover and call tools hosted on any compatible server — automatically, without you writing a single line of code. Instead of registering one endpoint at a time, you point qlar at an MCP server and it fetches the full list of available tools in a single step. The AI then decides on its own which tool to call, when to call it, and what arguments to pass.
This tutorial walks you through connecting an MCP server to your agent, exploring the tools it exposes, and verifying the result in a live conversation.
How MCP Works
MCP separates the work into two phases that happen in sequence every time your agent starts up:
-
Discovery — qlar sends a request to the MCP server's endpoint. The server responds with a structured list of tools: each tool has a name, a description, and an input schema. qlar registers each enabled tool as a function the AI can call.
-
Execution — during a conversation, the AI decides whether a tool is relevant to the user's message. If it is, qlar sends a tool-call request to the same MCP server, receives the result, and passes it back to the AI to incorporate into its reply.
MCP vs. Custom API
| Custom API | MCP | |
|---|---|---|
| How tools are defined | You define each endpoint manually | The server exports its tools automatically |
| Number of tools per config | 1 | Many (one server can expose dozens) |
| When to use | You own the API and control its schema | You want to connect to an existing MCP-compatible service |
Use Custom API when you are integrating a specific endpoint you own. Use MCP when you want to connect to a service that already speaks the MCP protocol.
Scenario Used in This Tutorial
This tutorial uses Context7 — a public MCP server that provides up-to-date documentation for software libraries. It is free, requires no account, and exposes two tools that the AI can use to look up accurate library docs on demand.
| Field | Value |
|---|---|
| MCP config name | context7_docs |
| Purpose | Retrieve documentation for any software library by name |
| Remote URL | https://mcp.context7.com/mcp |
| Authentication | None — public, no registration required |
| Tools discovered | resolve-library-id, get-library-docs |
Once you are comfortable with the steps, swap in any other MCP-compatible server URL.
Step 1 — Open MCP Configurations
Click the hamburger menu (☰) in the top-left corner to open the sidebar. Expand Actions, then click MCP.
The MCP Configurations page loads. It lists all MCP servers already connected to this agent.
If this is your first setup, the list may be empty. That is expected.
Step 2 — Add a New MCP Configuration
Click the Add New MCP button in the top section of the page. A sliding panel opens on the right side of the screen with a three-tab form: General, Authorization, and Tools.
Keep this panel open while following the next steps, because you will move through each tab in sequence.
Step 3 — Fill in the General Settings
You will work in the General tab first.
Name
Type context7_docs in the Name field. This name appears in the MCP list and is used internally to identify the configuration.
Description (optional)
Add a short note for your own reference:
Provides real-time documentation for software libraries via Context7.
Remote URL
In the Remote URL field, enter:
https://mcp.context7.com/mcp
This is the endpoint qlar will contact to discover tools and execute them. The URL must point to an MCP-compatible server that accepts SSE or HTTP transport.
Tip: If the server requires a specific path (e.g.,
/mcp,/sse, or/v1/mcp), include it in the URL. Contact the server provider if you are unsure which path to use.
Loading Text Type
Leave Loading Text Type set to auto. qlar will generate a context-aware loading message based on the tool being called.
Enable toggle
Leave the Enabled toggle on (default).
Before moving to the next tab, quickly re-check spelling for Name and Remote URL. Most connection issues in first-time setup come from small typos in the endpoint URL.
Step 4 — Configure Authorization
Click the Authorization tab.
For this scenario, Context7 is a public endpoint — no credentials are needed. Leave Authorization Type set to None and move on.
If your organization enforces private MCP servers, you can still continue this tutorial with None first, then switch to your required authorization type afterward.
If your MCP server requires authentication, see Authorization Options at the bottom of this page.
Step 5 — Save the Configuration
Click Save at the bottom of the sliding panel. qlar saves the configuration and immediately contacts the Remote URL to discover available tools.
Wait a few seconds after saving so the first discovery request can complete. If discovery fails, verify URL and authorization first before trying again.
Note: The Tools tab is only accessible after the configuration has been saved at least once. This is because qlar needs to connect to the server to fetch the tool list before you can review and select them.
Step 6 — Explore and Enable Tools
After saving, click the Tools tab. qlar displays all tools returned by the MCP server.
For Context7, you should see two tools:
| Tool name | What it does |
|---|---|
resolve-library-id | Converts a library name (e.g., react) into Context7's internal library ID |
get-library-docs | Returns documentation for a library given its ID and an optional topic |
By default, all discovered tools are enabled. You can disable individual tools using the toggle next to each one. Disabled tools remain in the list but are hidden from the AI — it will not call them.
At this stage, take 1-2 minutes to review each tool description. This helps you predict when the AI will invoke a specific tool during real conversations.
Tip: Leave both Context7 tools enabled. The AI typically chains them: it calls
resolve-library-idfirst to get the correct library ID, then callsget-library-docsto fetch the relevant documentation.
Click Save again after reviewing the tools.
Step 7 — Publish All Changes
Close the sliding panel and click Save all changes at the bottom of the MCP Configurations page. A confirmation dialog appears — click Confirm to publish.
Your agent now has access to both Context7 tools in all new conversations.
If your workspace uses Draft and Published separation, make sure you are publishing from the intended environment before testing with end users.
Step 8 — Verify in a Conversation
Open the live preview panel on the right side of any config page and send a message that should trigger the documentation lookup:
"How do I use the useState hook in React?"
or
"Show me how to create a route in Next.js 14."
qlar will call resolve-library-id to identify the correct library, then call get-library-docs to retrieve the relevant section, and finally present the documentation in a natural, conversational response.
For validation, check three things: the answer references the correct library, includes concrete usage guidance, and does not fall back to a generic response.
Tip: Try a question about a less common library — for example, "How do I configure Zod for nested object validation?" — to see how the AI handles library resolution across different ecosystems.
Advanced Features
The steps above cover the most common setup. The sections below explain features you may need as your integration grows.
Authorization Options
qlar supports five authorization methods for MCP servers. Select the Authorization Type in the Authorization tab and the required fields will appear.
| Type | When to use |
|---|---|
None | Public endpoints — no credentials needed |
Bearer | Servers secured with a static Bearer token |
Custom Header | Servers that use a custom header name (e.g., X-API-Key) |
Server OAuth | Servers using OAuth 2.0 handled on the server side (Client Credentials or Google Service Account) |
Client OAuth | Servers using OAuth 2.0 with a user login flow (Google or Microsoft) |
Bearer
Enter the token in the Token field. qlar sends it as Authorization: Bearer <token> on every request.
Custom Header
Enter the Header Name (e.g., X-API-Key) and the Value. qlar attaches this header to every request to the MCP server.
Server OAuth — Client Credentials Enter the Token URL, Client ID, and Client Secret. qlar fetches and refreshes the token automatically.
Server OAuth — Google Service Account Enter the Token URL and upload your Google Service Account JSON file. qlar handles JWT signing and token rotation.
Client OAuth — Google / Microsoft Enter the Client ID (and Tenant ID for Microsoft). The user completes the login flow in their browser; qlar then uses the resulting token for all tool calls.
For OAuth authorization types, you can also add Scopes — click Add Scope to append the permission scopes your server requires.
Loading Text Types
The Loading Text Type setting controls the message displayed to users while a tool is executing.
| Type | Behavior |
|---|---|
none | No loading message is shown |
fixed | Always shows the exact text you enter in Loading Text |
dynamic | Uses the Loading Text field as a prompt to generate a context-aware message |
auto | qlar generates a loading message automatically based on the tool being called |
auto is recommended for MCP integrations because tool names and purposes vary — qlar composes an appropriate message for each one without any extra configuration.
Disabling Individual Tools
If an MCP server exposes tools that are not relevant to your agent's purpose, disable them in the Tools tab rather than deleting the entire configuration. Disabled tools are hidden from the AI but remain in the list so you can re-enable them later.
Example: A server that exposes both
send-emailandread-inboxtools — you may want to enable onlyread-inboxif your agent should never send email on its own.
Refreshing the Tool List
When an MCP server adds or removes tools, the Tools tab in qlar does not update automatically. To re-fetch the tool list, open the configuration panel, click the Tools tab, and use the Refresh action. New tools appear disabled by default — review and enable the ones you need, then save.
Related Pages
- Call a Custom API — register a single external endpoint manually
- Automate with Plugins — connect pre-built plugin services
- Automate with Web Search — enable real-time web search for your agent