affinity-mcp-proxy

affinity-mcp-proxy

Proxies the local Affinity MCP server over stdio, enabling tools to call Affinity's tools like execute_script and search_sdk_hints via MCP.

Category
Visit Server

README

affinity-mcp-proxy

affinity-mcp-proxy exposes the local Affinity MCP server as an MCP server over stdio.

It is designed for tools that know how to launch MCP servers as local commands, for example:

{
  "mcpServers": {
    "affinity": {
      "command": "pnpm",
      "args": ["dlx", "affinity-mcp-proxy"]
    }
  }
}

What it does

  • connects to the local Affinity MCP server over HTTP/SSE
  • re-exposes tools/list and tools/call over stdio
  • primes execute_script with read_preamble in the same upstream session
  • ships a small CLI for diagnostics and direct tool calls

Status

  • first-class target: macOS
  • runtime: Node.js 22+
  • package manager: pnpm

Other platforms may work, but this package is only validated on macOS in the first release.

Install and run

Preferred ephemeral usage:

pnpm dlx affinity-mcp-proxy

Direct CLI usage:

pnpm dlx --package affinity-mcp-proxy affinity-mcp-proxy-cli list-tools
pnpm dlx --package affinity-mcp-proxy affinity-mcp-proxy-cli call-tool search_sdk_hints '{"query":"text style"}'

Local development:

pnpm install
pnpm test
pnpm dlx . --help
node ./affinity_mcp_proxy.mjs --help

Requirements

  • Affinity must be open
  • the local Affinity MCP server must be enabled and listening
  • Node.js 22 or newer

By default the proxy tries these upstream URLs:

  • http://127.0.0.1:6767/sse
  • http://127.0.0.1:6767
  • http://[::1]:6767/sse
  • http://[::1]:6767

Environment variables

  • AFFINITY_MCP_URL
    • force a specific upstream MCP URL
  • AFFINITY_MCP_CONNECT_TIMEOUT_MS
    • override the connection timeout
  • AFFINITY_MCP_DEBUG
    • enable proxy debug logs on stderr

The proxy requires the SDK to be installed through the package dependencies. There is no alternate local SDK fallback.

Commands

Proxy server:

pnpm dlx affinity-mcp-proxy
pnpm dlx affinity-mcp-proxy --help
pnpm dlx affinity-mcp-proxy --version

Diagnostic CLI:

pnpm dlx --package affinity-mcp-proxy affinity-mcp-proxy-cli list-tools
pnpm dlx --package affinity-mcp-proxy affinity-mcp-proxy-cli execute-script-file ./script.js
pnpm dlx --package affinity-mcp-proxy affinity-mcp-proxy-cli render-spread-file DOCUMENT_SESSION_UUID '{"spread_index":2,"out":"/tmp/spread-2.jpg"}'

Troubleshooting

If the proxy exits immediately:

  • confirm Affinity is open
  • confirm the local MCP endpoint is enabled
  • set AFFINITY_MCP_DEBUG=1 to see connection attempts
  • if your environment prefers a specific interface, set AFFINITY_MCP_URL explicitly

If text formatting scripts fail inside Affinity with COMMAND_FAILED, make sure the script sets the current spread to the target text node spread before calling doc.formatText(...).

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured