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.2.2.tar.gz (123.5 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.2.2-py3-none-any.whl (16.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for agentd-0.2.2.tar.gz
Algorithm Hash digest
SHA256 9cd2a4bd465dc9fd212af9260b5fb73dcd9c09866f05f9ffd87e06213f442724
MD5 28244db3f3110161599ea08b65e7c9bd
BLAKE2b-256 3b5927fea10f85828a2b4c3f763e6f0f2739d13a86ec84e2cfffaa088cabc59a

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for agentd-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 09c50f886d0558e89dd041ec0e0a18eee7f1447fcf401798fbf99432d7dc3c99
MD5 de489b5aa7f74d098c792b95d37683b3
BLAKE2b-256 8d94b07a64e0526b2c91b31d65c50ff6e500f4a1eba234ea29c0c642c2ca78d9

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