Skip to main content
Glama
yripper

Remote MCP Server on Cloudflare

by yripper

Servidor MCP remoto en Cloudflare

¡Pongamos en funcionamiento un servidor MCP remoto en Cloudflare Workers con inicio de sesión OAuth incluido!

Desarrollar localmente

# clone the repository
git clone git@github.com:cloudflare/ai.git

# install dependencies
cd ai
npm install

# run locally
npx nx dev remote-mcp-server-bearer-auth

Deberías poder abrir http://localhost:8787/ en tu navegador

Related MCP server: Remote MCP Server on Cloudflare

Conecte el inspector MCP a su servidor

Para explorar su nueva API de MCP, puede utilizar el Inspector de MCP .

  • Inícielo con npx @modelcontextprotocol/inspector

  • Dentro del inspector , cambie el Tipo de transporte a SSE e ingrese http://localhost:8787/sse como la URL del servidor MCP al que conectarse.

  • Agregue un token portador y haga clic en "Conectar"

  • Haga clic en "Herramientas de lista"

  • Ejecute la herramienta "getToken", que debería devolver el encabezado de autorización que configuró en el inspector

Conecte Claude Desktop a su servidor MCP local

{
  "mcpServers": {
    "remote-mcp-server-bearer-auth": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "http://localhost:8787/sse",
        "--header",
        "Authorization: Bearer ${AUTH_TOKEN}"
      ]
    },
    "env": {
      "AUTH_TOKEN": "..."
    }
  }
}

Implementar en Cloudflare

npm run deploy

Llame a su servidor MCP remoto recién implementado desde un cliente MCP remoto

Tal como lo hizo anteriormente en "Desarrollar localmente", ejecute el inspector MCP:

npx @modelcontextprotocol/inspector@latest

Luego ingrese la URL de workers.dev (ej: worker-name.account-name.workers.dev/sse ) de su Worker en el inspector como la URL del servidor MCP al cual conectarse y haga clic en "Conectar".

Ya te has conectado a tu servidor MCP desde un cliente MCP remoto. Puedes pasar un token de portador como se mencionó anteriormente.

Depuración

Si algo sale mal, puede ser útil reiniciar Claude o intentar conectarse directamente a su servidor MCP en la línea de comando con el siguiente comando.

npx mcp-remote http://localhost:8787/sse

En algunos casos excepcionales puede ser útil borrar los archivos agregados a ~/.mcp-auth

rm -rf ~/.mcp-auth

Available Tools

1 tool
get_list_tweetsC

Get tweets from a specific list

ParametersJSON Schema
NameRequiredDescriptionDefault
list_idYesID of the list to get tweets from
max_resultsNoMaximum number of tweets to return

TDQS

C2.9/5.0
Behavior2/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 mentions 'Get tweets' but doesn't disclose behavioral traits like read-only vs. destructive, authentication needs, rate limits, or response format. This leaves the agent with insufficient information for safe invocation.

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?

The description is a single, clear sentence with zero waste, making it highly concise and well-structured. It efficiently conveys the core purpose without unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations and no output schema, the description is incomplete. It doesn't cover behavioral aspects, usage context, or return values, making it inadequate for a tool with parameters and potential complexity.

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 description coverage is 100%, so the schema already documents both parameters (list_id and max_results). The description adds no additional meaning beyond what the schema provides, such as format details or usage tips, meeting the baseline for high coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Get tweets from a specific list' clearly states the action ('Get') and resource ('tweets from a specific list'), making the purpose understandable. However, it lacks specificity such as mentioning retrieval or listing, and with no sibling tools, it doesn't need to differentiate, so it's not a 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool, such as prerequisites, alternatives, or context. It simply states what it does without indicating usage scenarios, which is a significant gap.

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.

  1. 1 tool updatev1.0.0
    • Addedget_list_tweets

TDQS

B3.1/5.0

Scored across 1 tool

Disambiguation5/5

With only one tool, there is no possibility of ambiguity or overlap between tools. The tool's purpose is clearly defined and distinct by default.

Naming Consistency5/5

A single tool inherently has consistent naming, as there are no other tools to compare it against. The name 'get_list_tweets' follows a clear verb_noun pattern.

Tool Count2/5

One tool is generally too few for a server's purpose, as it limits functionality and suggests an incomplete or narrow scope. This is borderline inadequate for typical MCP server operations.

Completeness2/5

Inferring the domain as Twitter list management, the tool surface is severely incomplete. It only allows getting tweets from a list, with no capabilities for creating, updating, deleting lists, or interacting with tweets beyond retrieval, leading to significant gaps.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers