sofya-mcp
Officialsofya-mcp
MCP server for Sofya - web search, fetch, extract, and deep research for AI agents, exposed over the Model Context Protocol.
It runs locally over stdio and is a thin wrapper around the Sofya REST API. Bring your own Sofya API key.
Tools
Tool | What it does | Cost |
| Search the web and get extracted page content (not just snippets). Supports | 1-3 credits (+5 for |
| Fetch up to 10 URLs as clean markdown. Also handles PDF, DOCX, and more. | 1 credit / URL |
| Fetch a page and pull specific structured info using AI. | 5 credits |
| Decompose a question into sub-queries, read many sources in parallel, and synthesize a cited report. | 25 credits |
Related MCP server: Web Search MCP Server
Prerequisites
Node.js 18+
A Sofya API key - get one at sofya.co (keys look like
ay_live_...)
Quick start
Run it directly with npx - no install needed:
SOFYA_API_KEY=ay_live_... npx -y sofya-mcpConfiguration
Claude Code
claude mcp add sofya --env SOFYA_API_KEY=ay_live_... -- npx -y sofya-mcpClaude Desktop / Cursor / Windsurf / VS Code
Add this to your MCP config (e.g. claude_desktop_config.json, or .cursor/mcp.json):
{
"mcpServers": {
"sofya": {
"command": "npx",
"args": ["-y", "sofya-mcp"],
"env": {
"SOFYA_API_KEY": "ay_live_..."
}
}
}
}Codex
Add it with the Codex CLI:
codex mcp add sofya --env SOFYA_API_KEY=ay_live_... -- npx -y sofya-mcpOr edit ~/.codex/config.toml directly. Note Codex puts environment variables in
a nested [mcp_servers.<name>.env] table:
[mcp_servers.sofya]
command = "npx"
args = ["-y", "sofya-mcp"]
[mcp_servers.sofya.env]
SOFYA_API_KEY = "ay_live_..."Then run /mcp inside Codex to confirm the server is connected.
Already using Sofya's hosted MCP? Sofya also serves a remote MCP endpoint at
https://sofya.co/mcp(Bearer auth, no install). Use thissofya-mcppackage when you want a local stdio server launched by your client instead.
Environment variables
Variable | Required | Default | Description |
| yes | - | Your Sofya API key ( |
| no |
| Override the Sofya API base URL. |
CLI flags --api-key and --base-url take precedence over the env vars.
Run npx sofya-mcp --list-tools to print the tool schemas, or --help for options.
Development
git clone https://github.com/sofya-ai/sofya-mcp.git
cd sofya-mcp
npm install # also builds via the prepare script
npm run build # compile TypeScript to build/
npm run watch # recompile on change
npm run inspector # debug with @modelcontextprotocol/inspectorThe server is a single file, src/index.ts. Tool definitions
mirror Sofya's hosted MCP server exactly (same names, parameters, and defaults).
License
MIT - see LICENSE.
Available Tools
4 toolsextractA
Fetch a webpage and extract specific information using AI. Use this when you need structured data from a page (e.g. pricing, specs, contact info) rather than the raw content. Costs 5 credits.
Returns: content (the extracted text), url, credits_used, credits_remaining, usage (token counts).
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | The URL to extract from | |
| prompt | Yes | What information to extract (e.g. "list all pricing tiers with features" or "extract the author name and publication date") |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations, so description carries full burden. Mentions cost (5 credits) and return fields, indicating it's a read operation. Does not detail error cases, rate limits, or behavior on malformed URLs.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two compact sentences plus a return field list. Front-loaded with purpose. Every sentence adds value without redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple 2-param tool with clear description, it sufficiently covers purpose, usage, and output. Lacks error handling or edge case details, but overall complete for typical use.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage 100%, so parameters are already well-described in schema. Description adds credit cost and return fields but no new parameter-level detail beyond what schema provides.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Describes fetching a webpage using AI to extract structured data, clearly distinguishing from raw content. Gives examples like pricing, specs, contact info. Specific verb+resource+scope.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly states when to use (for structured data rather than raw content) and mentions credit cost. Suggests alternatives implicitly with sibling tools fetch and search. No explicit when-not-to-use.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
fetchA
Fetch one or more URLs and return their content as clean markdown. Use this to read articles, documentation, blog posts, or any page where you need the complete text, not just a snippet from search. Also supports PDF, DOCX, and other document formats. Costs 1 credit per URL. Max 10 URLs per request. Failed URLs are not charged.
Set include_raw_html=true to also get the raw HTML source in each result. Useful for inspecting embedded URLs, data attributes, iframes, or script tags that are stripped during markdown conversion. Returns null for non-HTML content (PDF, DOCX, etc.). Same cost.
Returns: results (array of {title, url, content, raw_html, published_time, success, error}), credits_used, credits_remaining.
| Name | Required | Description | Default |
|---|---|---|---|
| urls | Yes | List of URLs to fetch (max 10) | |
| include_raw_html | No | Include raw HTML source in each result (default false) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries full burden. It discloses credit cost, max URLs, failed URL charging, and behavior of 'include_raw_html' (returns null for non-HTML). It does not mention rate limits or robots.txt, but the disclosed info is solid.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-organized with clear paragraphs. It is concise but covers all key points. Slight redundancy like repeating 'max 10 URLs' could be trimmed, but overall efficient.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the lack of output schema, the description compensates by listing the return fields (title, url, etc.). It also addresses error handling, credit usage, and format support. For a tool with two parameters, this is sufficiently complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, but the description adds value by explaining the purpose of 'include_raw_html' (inspecting embedded elements) and its behavior for non-HTML content. It also clarifies credit usage per URL, which is not in the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb 'fetch', resource 'URLs', and output 'clean markdown'. It distinguishes from siblings by contrasting with 'snippet from search' and mentioning support for PDF/DOCX formats, making the purpose unambiguous.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly tells when to use the tool ('read articles, documentation, blog posts') and implicitly suggests when not to use it ('not just a snippet'). It also provides constraints like credit cost, max URLs, and failed URL policy. However, it does not directly compare with sibling tools 'extract' or 'research'.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
researchA
Perform comprehensive research on a topic. Decomposes your query into sub-queries, searches and reads multiple sources in parallel, then synthesizes a structured report with citations. Best for open-ended or comparative questions that need coverage from many angles. For simple factual lookups, use search instead (optionally with include_answer=true for cheap synthesis). Costs 25 credits.
Returns: query, report (structured markdown with citations), sources (array of {title, url, fetched}), sub_queries (the decomposed queries), credits_used, credits_remaining, usage (token counts).
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | The research question or topic | |
| topic | No | "general" (default) or "news" (prioritize recent news articles) | general |
| freshness | No | Filter by recency: "day", "week", "month", "year", or "YYYY-MM-DD:YYYY-MM-DD" | |
| max_sources | No | Maximum number of sources to use, 5-30 (default 20) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, so the description carries full burden. It discloses key behaviors: query decomposition, parallel source reading, synthesis, and credits consumption. Also lists return fields, offering comprehensive transparency.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Front-loaded with purpose, followed by usage guidance, cost, and return format. Every sentence is informative with no waste. The structure is logical and efficient.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Despite no output schema, the description lists all return fields (query, report, sources, sub_queries, credits_used, etc.), providing complete context for what the agent will receive. The process steps are also described, making the tool's behavior fully understood.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% with good descriptions in the schema. The tool description adds the credit cost but does not elaborate on parameter behavior beyond what is in the schema. Baseline 3 is appropriate as it adds marginal value.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states 'Perform comprehensive research on a topic' and explains the process (decomposes, searches, reads, synthesizes). It distinguishes from 'search' for simple lookups, making the tool's purpose specific and unambiguous.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly indicates best use ('open-ended or comparative questions') and when not to use ('simple factual lookups, use search instead'). Mentions cost (25 credits) and alternative tool with detail, providing clear guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
searchA
Search the web for current information on any topic. Returns extracted page content, not just snippets. Best for factual lookups, specific questions, or when you need a list of sources. For open-ended questions that need synthesis across many sources, use the research tool instead.
For news queries (current events, breaking news, politics, world events), set topic="news" to search news sources specifically. This returns recent articles with publication dates.
Set include_answer=true to get an AI-synthesized answer alongside results (adds 5 credits). This is the sweet spot for most agent tasks, e.g. basic + include_answer = 8 credits, much cheaper than a full 25-credit research call.
Returns: query, answer (if requested), results (array of {title, url, content, description, fetched, published_date}), search_depth, topic, elapsed_ms, credits_used, credits_remaining, altered_query.
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | The search query | |
| topic | No | "general" for web search, "news" for news articles. Use "news" for current events, breaking news, politics, or any time-sensitive query | general |
| freshness | No | Filter by recency: "day", "week", "month", "year", or "YYYY-MM-DD:YYYY-MM-DD" | |
| max_results | No | Number of results (default 10, max 20) | |
| search_depth | No | "basic" (default) for extracted page content (3 credits), "snippets" for SERP snippets only without page fetching (1 credit) | basic |
| include_answer | No | Generate an AI answer that synthesizes the search results (adds 5 credits) | |
| exclude_domains | No | Exclude results from these domains (max 10) | |
| include_domains | No | Only include results from these domains (max 10) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description fully compensates by disclosing credit costs for different search depths and include_answer, comparing costs to research (8 vs 25 credits), and detailing the return structure including 'altered_query'.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured with clear paragraphs: purpose, news guidance, cost details, and return fields. Every sentence is informative, front-loaded with purpose, and no superfluous text.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Despite having 8 parameters and no output schema, the description covers purpose, usage guidelines, parameter behavior, costs, and return format comprehensively. It addresses the tool's complexity adequately.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% with descriptions for all parameters. The description adds value by explaining credit costs and recommending when to use topic='news' and include_answer, going beyond schema alone.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's function: 'Search the web for current information on any topic' and notes it returns extracted page content. It distinguishes from the research sibling by directing open-ended synthesis questions there.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly states when to use: 'Best for factual lookups, specific questions, or when you need a list of sources' and when not: 'For open-ended questions that need synthesis across many sources, use the research tool instead.' Also provides guidance for news queries with topic='news'.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
4 tool updates
v0.1.0- First observed
extract - First observed
fetch - First observed
research - First observed
search
TDQS
Each tool has a clearly distinct purpose: extract for structured data from a single page, fetch for raw content, research for synthesized reports, and search for web searches. No overlap that would confuse an agent.
All tool names are single verbs (extract, fetch, research, search) following a consistent pattern. No mixed conventions or unclear naming.
Four tools is well-scoped for a server focused on web information retrieval and synthesis. Each tool earns its place without being too few or too many.
The tool set covers all major operations: fetching raw content, extracting structured data, searching the web, and performing deep research. No obvious gaps for the stated purpose.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Web data tools for AI agents: pages as markdown, search, maps, commerce, jobs, AI answers.
Web search, fetch, extract, and research for AI agents. Markdown output + AI-synthesized answers.
Web research for agents: quality-scored Google search, webpage extraction, and deep research.
Fetch pages as markdown, search web and news, extract structured data. For AI agents.
Related MCP Servers
- AlicenseAqualityCmaintenanceEnables AI agents to fetch any web page as clean markdown or screenshot it, turning URLs into LLM-ready context.211MIT
- FlicenseNot gradedqualityCmaintenanceEnables AI agents to perform web searches, extract webpage content, and conduct end-to-end search-and-extract operations using multiple search providers and content extraction methods.-
- AlicenseAqualityAmaintenanceEnables AI agents to search and fetch high-quality information from multiple sources, including general web APIs, Wikipedia, arXiv, Hacker News, Stack Exchange, and Crossref, with optional pro-mode deep research and clean markdown page extraction.10MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to search the web, read and extract content from webpages, fetch JSON from REST APIs, and collect links while bypassing anti-bot protections.36ISC
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/sofya-co/sofya-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server