MCP Fast Server

MCP Fast Server

MCP server that enables web search via DuckDuckGo and readable content extraction from HTML pages using FastMCP.

Category
访问服务器

README

EN

MCP Fast Server

An MCP (Model Context Protocol) server built with FastMCP that exposes two useful tools for agents/IDEs: web search via DuckDuckGo and readable content extraction from HTML pages.

Overview

  • search(query, max_results=5): searches the web and returns titles, links, and snippets.
  • fetch_content(url, timeout_seconds=15.0): fetches a URL and returns the main readable text (uses trafilatura; falls back to raw HTML if extraction fails).

Main implementation is in src/mcp_fast_server/server.py and the CLI is registered as mcp-fast-server via pyproject.toml.

Requirements

  • Python >= 3.10
  • uv installed (recommended for dependency management and execution)

Installation (with uv)

uv sync

This will install the dependencies defined in pyproject.toml (fastmcp, httpx, duckduckgo-search, trafilatura) into an isolated environment.

How to run

Direct (CLI)

uv run mcp-fast-server

This starts the MCP server over stdio and waits for a client to connect.

HTTP/Streamable HTTP and SSE

The server also supports modern HTTP transport (streamable-http) and legacy SSE.

  • Streamable HTTP (recommended):
uv run mcp-fast-server --transport streamable-http --host 127.0.0.1 --port 8000 --path /mcp
  • HTTP (alias compatible with streamable-http on recent versions):
uv run mcp-fast-server --transport http --host 127.0.0.1 --port 8000 --path /mcp
  • SSE (legacy):
uv run mcp-fast-server --transport sse --host 127.0.0.1 --port 8000 --path /mcp/sse

You can also set options via environment variables: MCP_TRANSPORT, MCP_HOST, MCP_PORT, MCP_PATH.

Integrating with an MCP client

Configure your MCP client to launch the command above via stdio. Example for the MCP Inspector:

{
  "mcpServers": {
    "mcp-fast-server": {
      "command": "uv",
      "args": ["run", "mcp-fast-server"]
    }
  }
}

In the Inspector, select the "mcp-fast-server", connect, and try the tools.

Client over HTTP/Streamable HTTP

Example configuration for clients that support HTTP/Streamable HTTP:

{
  "mcpServers": {
    "mcp-fast-server-http": {
      "url": "http://127.0.0.1:8000/mcp",
      "transport": "http"
    }
  }
}

Or using the explicit alias "streamable-http":

{
  "mcpServers": {
    "mcp-fast-server-stream": {
      "url": "http://127.0.0.1:8000/mcp",
      "transport": "streamable-http"
    }
  }
}

Client over SSE (legacy)

{
  "mcpServers": {
    "mcp-fast-server-sse": {
      "url": "http://127.0.0.1:8000/mcp/sse",
      "transport": "sse"
    }
  }
}

Tools (API)

  • search

    • Parameters:
      • query (str): search term
      • max_results (int, default 5): maximum number of results
    • Returns: List[Dict] with keys title, href, body, source
  • fetch_content

    • Parameters:
      • url (str): URL to fetch
      • timeout_seconds (float, default 15.0): HTTP timeout
    • Returns: str with the extracted main text; raw HTML if extraction fails.

Quick examples

  • Calling search with query="Model Context Protocol" returns up to 5 DuckDuckGo results with title/link/snippet.
  • Calling fetch_content with url="https://example.com" returns the main textual content of the page.

Project structure

src/
  mcp_fast_server/
    __init__.py
    server.py        # defines the tools and the entrypoint
pyproject.toml       # project metadata and mcp-fast-server script
README.md
README.en.md

Development

Open src/mcp_fast_server/server.py and edit/add tools decorated with @mcp.tool().

To run during development:

uv run mcp-fast-server

Add new dependencies in pyproject.toml and sync with:

uv sync

Build & distribution (optional)

You can build artifacts (wheel/sdist) with:

uv build

Artifacts will be placed in dist/.

Notes & limitations

  • Search uses DuckDuckGo via duckduckgo-search; follow ToS and access policies.
  • Content extraction uses trafilatura and may not work perfectly on all pages.
  • fetch_content follows redirects and raises for non‑successful HTTP responses.

License

Set the project license here (e.g., MIT, Apache-2.0). Update pyproject.toml accordingly if needed.

PT BR

MCP Fast Server · English README

Servidor MCP (Model Context Protocol) construído com FastMCP que expõe duas ferramentas úteis para agentes/IDE: pesquisa na web via DuckDuckGo e extração de conteúdo limpo de páginas HTML.

Visão geral

  • search(query, max_results=5): busca na web e retorna títulos, links e trechos.
  • fetch_content(url, timeout_seconds=15.0): baixa uma URL e retorna o texto principal legível (usa trafilatura; caso falhe, retorna o HTML bruto).

Implementação principal em src/mcp_fast_server/server.py e CLI registrada como mcp-fast-server via pyproject.toml.

Requisitos

  • Python >= 3.10
  • uv instalado (recomendado para gerenciar dependências e execução)

Instalação e setup (com uv)

# Dentro do diretório do projeto
uv sync

Isso instalará as dependências definidas em pyproject.toml (fastmcp, httpx, duckduckgo-search, trafilatura) em um ambiente isolado.

Como executar

Execução direta (CLI)

uv run mcp-fast-server

Isso inicia o servidor MCP via stdio, aguardando um cliente conectar.

HTTP/Streamable HTTP e SSE

O servidor também suporta transporte HTTP moderno (streamable-http) e SSE.

  • Streamable HTTP (recomendado):
uv run mcp-fast-server --transport streamable-http --host 127.0.0.1 --port 8000 --path /mcp
  • HTTP (alias compatível com streamable-http nas versões recentes):
uv run mcp-fast-server --transport http --host 127.0.0.1 --port 8000 --path /mcp
  • SSE (legado):
uv run mcp-fast-server --transport sse --host 127.0.0.1 --port 8000 --path /mcp/sse

As opções também podem ser passadas por variáveis de ambiente: MCP_TRANSPORT, MCP_HOST, MCP_PORT, MCP_PATH.

Integração com um cliente MCP

Configure seu cliente MCP para iniciar o comando acima via stdio. Exemplo com o MCP Inspector:

{
  "mcpServers": {
    "mcp-fast-server": {
      "command": "uv",
      "args": ["run", "mcp-fast-server"]
    }
  }
}

No Inspector, selecione o servidor "mcp-fast-server", conecte e teste as ferramentas.

Cliente via HTTP/Streamable HTTP

Exemplo de configuração para clientes que suportam HTTP/Streamable HTTP:

{
  "mcpServers": {
    "mcp-fast-server-http": {
      "url": "http://127.0.0.1:8000/mcp",
      "transport": "http"
    }
  }
}

Ou usando o alias explícito "streamable-http":

{
  "mcpServers": {
    "mcp-fast-server-stream": {
      "url": "http://127.0.0.1:8000/mcp",
      "transport": "streamable-http"
    }
  }
}

Cliente via SSE (legado)

{
  "mcpServers": {
    "mcp-fast-server-sse": {
      "url": "http://127.0.0.1:8000/mcp/sse",
      "transport": "sse"
    }
  }
}

Ferramentas (API)

  • search

    • Parâmetros:
      • query (str): termo de busca
      • max_results (int, padrão 5): máximo de resultados
    • Retorno: List[Dict] com chaves title, href, body, source
  • fetch_content

    • Parâmetros:
      • url (str): URL a ser baixada
      • timeout_seconds (float, padrão 15.0): timeout HTTP
    • Retorno: str com o texto principal extraído. Se a extração falhar, retorna o HTML.

Exemplos rápidos

  • Chamar search com query="Model Context Protocol" retorna até 5 resultados do DuckDuckGo com título/link/trecho.
  • Chamar fetch_content com url="https://example.com" retorna o corpo textual principal da página.

Estrutura do projeto

src/
  mcp_fast_server/
    __init__.py
    server.py        # define as ferramentas e o entrypoint
pyproject.toml       # metadata do projeto e script mcp-fast-server
README.md

Desenvolvimento

Abra src/mcp_fast_server/server.py e edite/adicione ferramentas decoradas com @mcp.tool().

Para executar durante o desenvolvimento:

uv run mcp-fast-server

Dependências novas podem ser adicionadas ao pyproject.toml e sincronizadas com:

uv sync

Build e distribuição (opcional)

Você pode gerar artefatos (wheel/sdist) do projeto com:

uv build

Os artefatos serão colocados em dist/.

Notas e limitações

  • A busca usa DuckDuckGo via duckduckgo-search; respeite termos de uso e políticas de acesso.
  • A extração de conteúdo usa trafilatura e pode não funcionar perfeitamente para todas as páginas.
  • fetch_content segue redirecionamentos e lança erro para respostas HTTP não bem-sucedidas.

Licença

Defina a licença do projeto e adicione aqui (ex.: MIT, Apache-2.0). Atualize também o pyproject.toml se necessário.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选