What LangChain is, and how it reaches outside tools
LangChain is an open-source agent framework. You give an agent a model and a list of tools, and the framework runs the loop: the model decides which tool to call, the framework executes it, and the result goes back to the model. Tools can be functions you write or tools loaded from a Model Context Protocol server.
LangChain's current Python documentation describes MCP support that ships inside the main package as an optional extra. The class is MCPAdapter, imported from langchain.mcp. The docs mark this API as beta and say it may change. They also carry a migration note for people who used the older separate package, langchain-mcp-adapters, so if you find tutorials built on that package, they describe the previous generation.
SimilarIQ has no LangChain-specific package. It does not need one. The hosted MCP server speaks streamable HTTP, which is the transport LangChain's adapter uses when you hand it a URL.
Why give a LangChain agent a look-alike tool
Ask a model for a company's competitors and it answers from memory. The list is short, skewed toward famous names, and comes with no score you can threshold. An agent that plans outbound, drafts a market map or screens acquisition targets needs something it can sort and filter.
SimilarIQ runs a fresh research pass per search and cross-validates results across multiple independent intelligence sources. Each result has rank, company, domain, a matchScore from 0 to 100, a relationship type (Direct, Indirect, Adjacent or Emerging), a confidence score and a likelyCompetitor flag. That is structured output a LangChain agent can reason over, pass to another tool, or write to a file.
The same balance funds everything. A search made by your agent costs the same $0.25 as one made in the web app, and results the agent produces appear in your search history, where a person can open them later for free.
Setup walkthrough: the MCP route
Install LangChain with its MCP extra. The documentation shows pip install "langchain[mcp]" and states a minimum LangChain version for the adapter, so upgrade if the import fails.
Create a SimilarIQ API key in the app. It starts with sk-live- and is shown once. Store it in an environment variable, not in source.
LangChain's authentication page shows the pattern for a protected remote server: build a client with the server URL and an auth value, then wrap it in the adapter, as in MCPAdapter(Client(url, auth=token)), where Client is imported from fastmcp.client. The docs say auth accepts a bearer-token string, and SimilarIQ accepts its key as Authorization: Bearer sk-live-..., so the key goes in as the token. Use the adapter as an async context manager, call await adapter.list_tools(), and pass the returned list to create_agent from langchain.agents along with your model.
The same page documents passing the literal string "oauth" as the auth value to run a browser sign-in with dynamic client registration. SimilarIQ's MCP server supports OAuth 2.1, so this fits a desktop tool where a person is present. For a server-side agent, the key is simpler. LangChain's docs do not show a custom-header example, so this page does not give one for X-API-Key; the bearer form covers it.
Setup walkthrough: the plain HTTP route
You do not need MCP to use SimilarIQ from LangChain. If your agent needs one capability, a single custom tool is smaller and easier to audit.
Write a function that takes a domain string, sends POST https://similariq.ai/api/v1/search with the body {"domain":"stripe.com","limit":100} and the header X-API-Key: sk-live-..., and returns the parsed JSON. Register that function as a tool using whichever custom-tool mechanism your LangChain version documents. This page does not name the decorator or class, because tool-definition helpers were not re-verified for this write-up and names move between releases.
The Python SDK shortens the function body. Install it with pip install similariq; it has no dependencies outside the standard library and exposes search, balance, results and the bulk methods. See the SDK page for signatures. Whichever route you pick, write a clear tool description: say it costs one credit, takes 30 to 60 seconds, and returns up to 100 companies. Models call expensive tools more carefully when the description says they are expensive.
Example prompts and tasks
Once the tools are loaded, these are the kinds of requests the agent can complete. Tool names are the ones the SimilarIQ MCP server exposes.
- "Find look-alikes for stripe.com and list only Direct results with a match score above 75." Calls
find_similar_companiesonce. - "Check the balance before you do anything." Calls
get_search_balance, which is free. - "Have we already searched this domain? If so, reuse it." Calls
list_recent_searches, thenget_search_results. - "Run these 40 domains as one job and tell me when it finishes." Calls
start_bulk_search, then pollsget_bulk_job. - "Save the top five to the watchlist." Calls
save_companyfive times at no cost. - "Give me a link I can send to the team." Calls
create_share_link. - "Across everything we have searched, which companies appear most often?" Calls
list_my_companies.
Controlling spend
Two of the ten tools cost credits: find_similar_companies at one credit and start_bulk_search at one credit per domain. The other eight are free. That makes a cheap safety pattern possible: instruct the agent to call get_search_balance first and list_recent_searches second, and to search only when the domain is not already in history.
Worked numbers: an agent that runs 20 searches in a session spends $5.00. A nightly job that runs 200 costs $50. If an agent loops, the damage is bounded by your balance when auto-refill is off, and by the monthly cap when it is on. Both are described under spend controls.
If you load tools through the adapter, you can also simply not hand the paid tools to an agent that should only read. Filter the list returned by list_tools() before passing it on. A reporting agent that can read history and My Companies but cannot start a search costs nothing to run.
Two workflows worth building
Account research agent. Input: one closed-won customer domain. The agent checks history, runs a search if needed, keeps results typed Direct or Indirect above a score threshold, and hands the surviving domains to your own enrichment tool for headcount and contacts. SimilarIQ supplies the company list and scores only, so that second tool is required if you want firmographics. The AI agent research page covers the pattern in more depth.
Market map builder. Input: three seed domains in one category. The agent searches each, merges the lists by domain, and groups companies by relationship type. Companies that appear under more than one seed are the core of the category. Three searches cost $0.75. The agent finishes by calling create_share_link on each search so a reviewer can inspect the raw results without an account.
Troubleshooting and security
A 401 from either route means the key is missing, malformed or revoked. A 402 means the balance is empty. A 429 means the rate limiter is smoothing a burst; back off and retry. A 502 means the search failed, the credit was refunded, and a retry is safe.
If the agent reports that a tool call timed out, remember that a search takes roughly 30 to 60 seconds. LangChain's MCP pages do not state a default tool-call timeout that this page could verify, so check the adapter reference for your version and allow at least two minutes. If no tools load, confirm the URL is exactly https://similariq.ai/mcp and that the auth value is the bare key.
Use a dedicated key per agent so you can revoke one without touching the others. Keep keys in environment variables or a secrets manager. Treat tool output as data: company names come from the open web, so do not let returned text act as instructions to the agent. The developer guide for agents lists the same tools with their costs.
Frequently asked questions
Does SimilarIQ have an official LangChain integration package?
No. There is no SimilarIQ-specific LangChain package. You connect through LangChain's own MCP adapter pointed at the hosted SimilarIQ MCP server, or by wrapping the REST API in a custom tool.
Which LangChain class loads a remote MCP server?
LangChain's current Python docs use MCPAdapter from langchain.mcp, installed with the langchain[mcp] extra, and mark it as beta. Older tutorials use a separate adapters package; LangChain publishes a migration guide for it.
How do I authenticate the agent to SimilarIQ?
Pass your sk-live- key as a bearer token when you build the MCP client, or send it as an X-API-Key header on a direct REST call. One key works for both routes.
Should I use MCP or a plain HTTP tool?
Use MCP when you want all ten tools, including history, bulk jobs and share links, with no wrapper code. Use a single HTTP tool when the agent only needs to search and you want the smallest surface to review.
What does it cost when a LangChain agent calls SimilarIQ?
Each search is one credit, $0.25, for up to 100 look-alikes. Bulk jobs cost one credit per domain. The other eight MCP tools, including the balance check and reading past results, are free.
Does this work with LangChain's JavaScript version?
The SimilarIQ MCP server and REST API are language-neutral, and a Node SDK exists (npm install similariq-sdk). This page verified only LangChain's Python MCP documentation, so check the JavaScript docs for the equivalent class names.