MCPcopy Index your code
hub / github.com/anyproto/anytype-mcp

github.com/anyproto/anytype-mcp @v1.2.9

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.2.9 ↗ · + Follow
85 symbols 237 edges 28 files 8 documented · 9%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Anytype MCP Server

NPM version Add anytype MCP server to Cursor Add MCP Server anytype to LM Studio Add to Kiro

The Anytype MCP Server is a Model Context Protocol (MCP) server enabling AI assistants to seamlessly interact with Anytype's API through natural language.

It bridges the gap between AI and Anytype's powerful features by converting Anytype's OpenAPI specification into MCP tools, allowing you to manage your knowledge base through conversation.

Features

  • Global & Space Search
  • Spaces & Members
  • Objects & Lists
  • Properties & Tags
  • Types & Templates

Quick Start

1. Get Your API Key

  1. Open Anytype
  2. Go to App Settings
  3. Navigate to API Keys section
  4. Click on Create new button

Alternative: Get API key via CLI

You can also get your API key using the command line:

npx -y @anyproto/anytype-mcp get-key

2. Configure Your MCP Client

Claude Desktop, Cursor, Windsurf, Raycast, etc.

Add the following configuration to your MCP client settings after replacing <YOUR_API_KEY> with your actual API key:

{
  "mcpServers": {
    "anytype": {
      "command": "npx",
      "args": ["-y", "@anyproto/anytype-mcp"],
      "env": {
        "OPENAPI_MCP_HEADERS": "{\"Authorization\":\"Bearer <YOUR_API_KEY>\", \"Anytype-Version\":\"2025-11-08\"}"
      }
    }
  }
}

Tip: After creating an API key in Anytype, you can copy that ready-to-use configuration snippet with your API key already filled in from the API Keys section.

Claude Code (CLI)

Run this command to add the Anytype MCP server after replacing <YOUR_API_KEY> with your actual API key:

claude mcp add anytype -e OPENAPI_MCP_HEADERS='{"Authorization":"Bearer <YOUR_API_KEY>", "Anytype-Version":"2025-11-08"}' -s user -- npx -y @anyproto/anytype-mcp

Alternative: Global Installation

If you prefer to install the package globally:

  1. Install the package:
npm install -g @anyproto/anytype-mcp
  1. Update your MCP client configuration to use the global installation:
{
  "mcpServers": {
    "anytype": {
      "command": "anytype-mcp",
      "env": {
        "OPENAPI_MCP_HEADERS": "{\"Authorization\":\"Bearer <YOUR_API_KEY>\", \"Anytype-Version\":\"2025-11-08\"}"
      }
    }
  }
}

Custom API Base URL

By default, the server connects to http://127.0.0.1:31009. For anytype-cli (port 31012) or other custom base URLs, set ANYTYPE_API_BASE_URL:

Example Configuration

MCP Client (Claude Desktop, Cursor, etc.):

{
  "mcpServers": {
    "anytype": {
      "command": "npx",
      "args": ["-y", "@anyproto/anytype-mcp"],
      "env": {
        "ANYTYPE_API_BASE_URL": "http://localhost:31012",
        "OPENAPI_MCP_HEADERS": "{\"Authorization\":\"Bearer <YOUR_API_KEY>\", \"Anytype-Version\":\"2025-11-08\"}"
      }
    }
  }
}

Claude Code (CLI):

claude mcp add anytype \
  -e ANYTYPE_API_BASE_URL='http://localhost:31012' \
  -e OPENAPI_MCP_HEADERS='{"Authorization":"Bearer <YOUR_API_KEY>", "Anytype-Version":"2025-11-08"}' \
  -s user -- npx -y @anyproto/anytype-mcp

Example Interactions

Here are some examples of how you can interact with your Anytype:

  • "Create a new space called 'Project Ideas' with description 'A space for storing project ideas'"
  • "Add a new object of type 'Task' with title 'Research AI trends' to the 'Project Ideas' space"
  • "Create a second one with title 'Dive deep into LLMs' with due date in 3 days and assign it to me"
  • "Now create a collection with the title "Tasks for this week" and add the two tasks to that list. Set due date of the first one to 10 days from now"

Development

Installation from Source

  1. Clone the repository:
git clone https://github.com/anyproto/anytype-mcp.git
cd anytype-mcp
  1. Install dependencies:
npm install -D
  1. Build the project:
npm run build
  1. Link the package globally (optional):
npm link

Contribution

Thank you for your desire to develop Anytype together!

❤️ This project and everyone involved in it is governed by the Code of Conduct.

🧑‍💻 Check out our contributing guide to learn about asking questions, creating issues, or submitting pull requests.

🫢 For security findings, please email security@anytype.io and refer to our security guide for more information.

🤝 Follow us on Github and join the Contributors Community.


Made by Any — a Swiss association 🇨🇭

Licensed under MIT.

Extension points exported contracts — how you extend this code

AuthToken (Interface)
(no doc)
src/auth/get-key.ts
ToolMethod (Interface)
(no doc)
src/openapi/__tests__/parser.test.ts
AuthTemplate (Interface)
(no doc)
src/auth/types.ts
Tool (Interface)
(no doc)
src/openapi/__tests__/parser.test.ts
SecurityScheme (Interface)
(no doc)
src/auth/types.ts
Tools (Interface)
(no doc)
src/openapi/__tests__/parser.test.ts
Server (Interface)
(no doc)
src/auth/types.ts
TestCase (Interface)
(no doc)
src/openapi/__tests__/parser.test.ts

Core symbols most depended-on inside this repo

convertToMCPTools
called by 27
src/openapi/parser.ts
executeOperation
called by 16
src/client/http-client.ts
loadOpenApiSpec
called by 11
src/init-server.ts
loadSpec
called by 10
cli/openapi-client.ts
parseBaseUrlFromEnv
called by 8
src/utils/base-url.ts
convertOpenApiSchemaToJsonSchema
called by 8
src/openapi/parser.ts
determineBaseUrl
called by 7
src/utils/base-url.ts
getDefaultSpecUrl
called by 5
src/utils/base-url.ts

Shape

Method 38
Function 24
Class 14
Interface 9

Languages

TypeScript100%

Modules by API surface

src/openapi/parser.ts20 symbols
src/openapi/__tests__/parser.test.ts9 symbols
src/mcp/proxy.ts9 symbols
src/client/http-client.ts9 symbols
src/auth/get-key.ts9 symbols
src/init-server.ts5 symbols
src/mcp/__tests__/proxy.test.ts4 symbols
src/auth/types.ts4 symbols
scripts/__tests__/start-server.test.ts4 symbols
src/utils/base-url.ts3 symbols
scripts/start-server.ts2 symbols
cli/openapi-client.ts2 symbols

For agents

$ claude mcp add anytype-mcp \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact