Skip to main content

agent daemon

Project description

agentd

View sample configs in the config/ directory

to run:

uvx agentd config.yaml

Built using mcp-subscribe a way for agents to subscribe to any MCP's tools

MCP with chat completions

Building this I realized building an MCP Client with which to use your servers is too complex. Enter patch_openai_with_mcp.

Just wrap the openai client and pass it mcp_servers=[…]. You can use the MCPServerStdio or MCPServerSSE classes from openai-agents. I'm not sure why openai hadn't done this yet to be honest so I decided to scratch my own itch.

Example:

from agents.mcp.server import MCPServerStdio
from agentd.patch import patch_openai_with_mcp
from openai import OpenAI

fs_server = MCPServerStdio(
    params={
        "command": "npx",
        "args": ["-y", "@modelcontextprotocol/server-filesystem", "/tmp/"],
    },
    cache_tools_list=True
)

client = patch_openai_with_mcp(OpenAI())  # Get the patched client back

response = client.chat.completions.create(
    #model="gpt-4o",
    #model="claude-3-5-sonnet-20240620",
    model="gemini/gemini-2.0-flash",
    messages=[
        {"role": "user", "content": "List the files in /tmp/ using the tool"}
    ],
    mcp_servers=[fs_server],
    mcp_strict=True
)

print(response.choices[0].message.content)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agentd-0.1.5.tar.gz (114.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agentd-0.1.5-py3-none-any.whl (13.3 kB view details)

Uploaded Python 3

File details

Details for the file agentd-0.1.5.tar.gz.

File metadata

  • Download URL: agentd-0.1.5.tar.gz
  • Upload date:
  • Size: 114.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.8

File hashes

Hashes for agentd-0.1.5.tar.gz
Algorithm Hash digest
SHA256 19d842aa4e54663ccbccc78f3dc25cd9ebe45014d2342ad521d09d3e43beb05f
MD5 59b27db05942a217ac42e801c4661aae
BLAKE2b-256 f09fccb08fffc890cb7adca0ede6db8e2a05f8d938326d900f9c0862ac0f3a4f

See more details on using hashes here.

File details

Details for the file agentd-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: agentd-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 13.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.8

File hashes

Hashes for agentd-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 3ef6515b7290980f5aeb82c570def8477c6ed7d2d2e79fe7c9e1281c2a779388
MD5 97fd04dfde0908355cebeb707334b8fd
BLAKE2b-256 cc00df8159303e5e2d47040f6292a63cfa99e04d9b7ae18e9c2aba6beb3e85a1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page