Skip to main content
Glama
sofya-co

sofya-mcp

Official
by sofya-co

sofya-mcp

npm version

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

Search the web and get extracted page content (not just snippets). Supports news topic, domain filters, freshness, and optional AI-synthesized answer.

1-3 credits (+5 for include_answer)

fetch

Fetch up to 10 URLs as clean markdown. Also handles PDF, DOCX, and more.

1 credit / URL

extract

Fetch a page and pull specific structured info using AI.

5 credits

research

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-mcp

Configuration

Claude Code

claude mcp add sofya --env SOFYA_API_KEY=ay_live_... -- npx -y sofya-mcp

Claude 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-mcp

Or 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 this sofya-mcp package when you want a local stdio server launched by your client instead.

Environment variables

Variable

Required

Default

Description

SOFYA_API_KEY

yes

-

Your Sofya API key (ay_live_...).

SOFYA_BASE_URL

no

https://sofya.co

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/inspector

The 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 tools
extractA

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).

ParametersJSON Schema
NameRequiredDescriptionDefault
urlYesThe URL to extract from
promptYesWhat information to extract (e.g. "list all pricing tiers with features" or "extract the author name and publication date")

TDQS

A4/5.0
Behavior3/5

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.

Conciseness5/5

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.

Completeness4/5

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.

Parameters3/5

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.

Purpose5/5

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.

Usage Guidelines4/5

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
urlsYesList of URLs to fetch (max 10)
include_raw_htmlNoInclude raw HTML source in each result (default false)

TDQS

A4.3/5.0
Behavior4/5

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.

Conciseness4/5

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.

Completeness4/5

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.

Parameters4/5

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.

Purpose5/5

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.

Usage Guidelines4/5

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).

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYesThe research question or topic
topicNo"general" (default) or "news" (prioritize recent news articles)general
freshnessNoFilter by recency: "day", "week", "month", "year", or "YYYY-MM-DD:YYYY-MM-DD"
max_sourcesNoMaximum number of sources to use, 5-30 (default 20)

TDQS

A4.7/5.0
Behavior5/5

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.

Conciseness5/5

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.

Completeness5/5

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.

Parameters3/5

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.

Purpose5/5

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.

Usage Guidelines5/5

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.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 4 tool updatesv0.1.0
    • First observedextract
    • First observedfetch
    • First observedresearch
    • First observedsearch

TDQS

A4.5/5.0
Disambiguation5/5

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.

Naming Consistency5/5

All tool names are single verbs (extract, fetch, research, search) following a consistent pattern. No mixed conventions or unclear naming.

Tool Count5/5

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.

Completeness5/5

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

ActivityStale
ResponsivenessSyncing

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

Related MCP Servers

  • F
    license
    Not graded
    quality
    C
    maintenance
    Enables 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.
    -
  • A
    license
    A
    quality
    A
    maintenance
    Enables 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.
    10
    MIT

Latest Blog Posts

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