Archon and Claude Code

Wondering if anyone has successfully accessed Archon from Claude Code (not Claude Desktop).

I was able to successfully add an MCP reference to Claude Code using the command:
claude mcp add <name> <command> [args...]

Archon shows in the MCP list:

! claude mcp list
โŽฟ archon: http://127.0.0.1:8100

However when I try to prompt Claude Code to use Archon and it attempts to query Archon, it trys a couple of times and gives up:

โบ I'll use Archon to query the Pydantic documentation and create a graph_example.py file for you.

โบ Bash(claude mcp call archon help)โ€ฆ

โบ Bash(claude mcp call archon help)โ€ฆ
  โŽฟ  error: unknown command 'call'
     Exit code 1

  Bash(claude mcp --help)โ€ฆ

โบ Bash(claude mcp --help)โ€ฆ
  โŽฟ  Usage: claude mcp [options] [command]

     Configure and manage MCP servers

     Options:
       -h, --help                                display help for command

     Commands:
       serve                                     Start the Claude Code MCP server
       add [options] <name> <command> [args...]  Add a stdio server
       remove [options] <name>                   Remove an MCP server
       list                                      List configured MCP servers
       get <name>                                Get details about an MCP server
       help [command]                            display help for command

  Bash(claude mcp serve --help)โ€ฆ

โบ Bash(claude mcp serve --help)โ€ฆ
  โŽฟ  Usage: claude mcp serve [options]

     Start the Claude Code MCP server

     Options:
       -h, --help  display help for command

โบ Bash(claude mcp list)โ€ฆ
  โŽฟ  archon: http://127.0.0.1:8100

โบ Bash(curl -s http://127.0.0.1:8100/help)โ€ฆ
  โŽฟ  Command 'curl' is not allowed for security reasons

โบ Let me try a different approach. I'll create a Python script that will query documentation about Pydantic and create a graph

I will continue to work on this and report back if I have success.

If anyone has already succeeded please post your solution. Thanks.

1 Like

Removed MCP and re-added as Pydantic-tool. I started Claude Code again and notice this error on StartUp:

โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ โœป Welcome to Claude Code research preview!        โ”‚
โ”‚                                                   โ”‚
โ”‚   /help for help                                  โ”‚
โ”‚                                                   โ”‚
โ”‚   cwd: /[PATH HIDDEN]  โ”‚
โ”‚                                                   โ”‚
โ”‚   โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ โ”‚
โ”‚                                                   โ”‚
โ”‚   MCP Servers:                                    โ”‚
โ”‚                                                   โ”‚
โ”‚   โ€ข PydanticAI-Tool                        failed โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

Continuing to explore โ€ฆ

Exposed Archon MCP for external use since I realized the connection was probably made from Anthropic servers.

Same error.

I do seem to be able to hit Archon from the browser but receive the

{โ€œdetailโ€:โ€œNot Foundโ€}

response. I suspect I am missing something from configuration but have yet to find anything in claude code documentation that indicates where config for claude code is stored.

Still exploring โ€ฆ

Thanks for trying to get Archon to work with Claude Code! I havenโ€™t personally myself yet, so Iโ€™m not sure exactly what configuration would have to be different.

What is the you gave for Archon with the CLI command to set up the server?

1 Like

@ColeMedin

What is the you gave for Archon with the CLI command to set up the server?

Are you asking for the command? That was:

claude mcp add PydanticAI-Tool http://[IP]:8100

I think that more is needed possibly for args โ€ฆ

I would take a look at the command for Cursor and use something similar!

1 Like

I finally got claude code to connect to the mcp for archon.

  1. Run archon docker script python run_docker.py
  2. Open Archon and start the MCP Server
  3. Open a terminal and execute claude mcp add Archon docker -- run -i --rm -e https://0.0.0.0:8100 archon-mcp:latest
  4. Run command claude
    You should see the open title with
 โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ โ”‚
โ”‚                                                   โ”‚
โ”‚   MCP Servers:                                    โ”‚
โ”‚                                                   โ”‚
โ”‚   โ€ข Archon                              connected โ”‚

Beware of the example in the documentation The command must precede the double dash (--) Also note that I inserted the URI to the docker process directly instead of following the example and using a environment variable (for some reason when I included this the import process did not see it correctly).

Also, further on you will find a reference to claude mcp add-json not sure if this is old or too new, but add-json is an unknown command (at least for the version of claude code I am running and I updated to latest version as of today).

Well I was a bit hasty. While Claude Code will connect to Archon, it is not completely working yet. Claude Code can connect to Archon but query it properly yetโ€ฆ

โบ Archon:run_agent (MCP)(thread_id: "69a51641-41e3-4752-85de-d2b879266b0a", user_input: "Please show me a complete example of a weather agent using pydantic_ai. I need the full code for a weather agent that can check current conditions โ€ฆ
                        and forecasts for a given location.")
  โŽฟ  Error calling tool run_agent: undefined

โบ I'm experiencing technical issues with the Archon tool. Let me create a weather agent based on the example template we've seen:

Looking at the docker logs for the MCP Instance I find this error repeated multiple times:

2025-03-11 21:32:13 {"jsonrpc":"2.0","id":5,"result":{"content":[{"type":"text","text":"Error executing tool run_agent: HTTPConnectionPool(host='localhost', port=8100): Max retries exceeded with url: /invoke (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0xffffa53b77a0>: Failed to establish a new connection: [Errno 111] Connection refused'))"}],"isError":true}}

Indicating that the app is not found locally on port 8100.
The Archon MCP Server is running and appears to using port 8100.

So some progress made but not there yet โ€ฆ

Found a handy tool at Model Context Protocol that was created to debug MCP Services.

Ran this. I was able to create a thread ID, however when I called run_agent tool I received the same error that I saw when running from claude.

Now looking at the definition of the run_agent tool โ€ฆ

I finally got this to work!

Solution:

  1. Start Archon and open the UI.
  2. Start the MCP Agent
  3. In a terminal enter: claude mcp add Archon docker -- run -i --rm -e GRAPH_SERVICE_URL=http://host.docker.internal:8100 archon-mcp:latest
  4. Start Claude Code - see text below for sample query and response.
โ”‚   โ€ข Archon                              connected โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

> Send this query to Archon "What is PydanticAI?"

โบ Let me create a new thread for Archon and send your query.

โบ Archon:create_thread (MCP)โ€ฆ
  โŽฟ  a13990da-ab56-4865-b63b-341688fe6f5d

โบ Archon:run_agent (MCP)(thread_id: "a13990da-ab56-4865-b63b-341688fe6f5d", user_input: "What is PydanticAI?"โ€ฆ

  โŽฟ  PydanticAI is a framework designed to facilitate the development of production-grade applications
     leveraging Generative AI. It is built on the principles of Pydantic, a data validation library in
     Python, and aims to streamline the integration of AI models while maintaining structured and
     type-safe interactions. Here are the key features and purposes of PydanticAI:

     ### Key Features
     - **Built by the Pydantic Team:** It is developed by the creators of Pydantic, ensuring solid
     validation and structure in applications.
     - **Model-agnostic Integration:** PydanticAI supports various AI models such as OpenAI, Anthropic,
     Gemini, and allows developers to extend support for other models easily.
     - **Type-safe Design:** The framework is designed to enhance type checking and validation, helping
     avoid errors during development.
     - **Dependency Injection System:** It provides an optional system for managing dependencies and
     testing more efficiently.
     - **Graph Support:** PydanticAI facilitates handling complex application flows through graph
     definitions using typing hints.
     - **Streamlined Responses:** The framework allows for real-time streaming of LLM outputs with
     immediate validation, which is crucial for timely and accurate interactions.

     ### Purpose
     PydanticAI aims to provide a user-friendly experience akin to FastAPI but focused on AI applications.
      It simplifies the process of building AI-driven projects, promoting standard Python practices and
     maintaining a high level of data integrity through strict validation.

     For further details about PydanticAI, you can refer to the [PydanticAI Official
     Documentation](https://ai.pydantic.dev/).

     If you're interested in building a specific AI agent or need further assistance, let me know!

โบ PydanticAI is a framework from the Pydantic team that helps build production-grade AI applications. It's
   model-agnostic (works with OpenAI, Anthropic, Gemini), provides type-safe design, dependency injection,
   and real-time streaming of LLM outputs with validation. Think of it as "FastAPI for AI applications."
2 Likes

Nice work!! Would you be down to make a PR to include instructions for getting this set up with Claude Code in the MCP section? Otherwise I can add it in! Claude Code seems pretty powerful so Iโ€™d love to include it in the mix

1 Like

Will do - thanks! Another cool thing about Claude code is you can run it as an MCP server as well - possibilities possibilities!

UPDATE: PR Has been created.

1 Like

I appreciate it a lot!

1 Like

Great work,
I am still on the waiting list for claude codeโ€ฆ
Do you think it is a problem to have archon using a model (openAI or ollama if you follow the doc) and claude code using claude ?
It seems the processes are complety independant, I was wondering, if you had any issue.

1 Like

@renaud I did not. The two process are completely independant.

Good to know. thank you

It seems a very good set-up, claude code + archon for the agent development.
Are you happy about it ?
Can you have a good interaction between claude code and archon while working on AI agent ?

2 Likes

@renaud,

So far. I have only performed a few short tests with it so far. These have been successful. I especially want to see if I can get it (claude code paired with archon) to work in an MCP to be callable from n8n or other augmented workflows. This should be possible as Claude Code can run in MCP mode.

Have you tried using it yet? I am curious to hear how this pairing works for others.

Regards,

David

1 Like

Thanks for this. Iโ€™m heading in the same direction. Much appreciated.

2 Likes