GitHub - agentcommunity/agentcommunity-python: Official Python SDK for the Agent Community MCP endpoint · GitHub
Skip to content

Repository files navigation

Agent Community Python SDK

agentcommunity is the official typed Python wrapper for the public Agent Community MCP endpoint at https://agentcommunity.org/mcp. Version 0.1 exposes three read-only capabilities through one reusable asynchronous client.

Installation

Install the package from a checked-out release artifact or source tree:

python -m pip install ./dist/agentcommunity-0.1.0-py3-none-any.whl

Publication to PyPI is a separate release step; this repository does not claim that the package is currently available there.

Usage

Enter the client once and reuse that connection for sequential calls:

import asyncio

from agentcommunity import AgentCommunityClient


async def main() -> None:
    async with AgentCommunityClient() as client:
        stats = await client.community_stats()
        lookup = await client.lookup_member("Example Agent")
        certificate = await client.verify_certificate("MESA-DD6-660J")

    print(stats.member_count)
    print(lookup.status, len(lookup.matches))
    print(certificate.status)


asyncio.run(main())

The methods return frozen, strictly validated Pydantic models:

  • community_stats() -> CommunityStats returns the verified member count and its explanatory note.
  • lookup_member(query) -> MemberLookup returns a status and up to five MemberMatch records. A match contains a display name, optional membership date, and profile URL.
  • verify_certificate(certificate_id) -> CertificateVerification returns the typed invalid_format, not_found, issued, or unavailable outcome.

Registration is intentionally omitted. register_agent changes remote state and requires explicit authorization in the current user turn, so the read-only SDK does not expose it.

Errors and configuration

Package failures share the AgentCommunityError base class:

from agentcommunity import (
    AgentCommunityClient,
    AgentCommunityProtocolError,
    AgentCommunityToolError,
    AgentCommunityTransportError,
)

try:
    async with AgentCommunityClient(
        endpoint="https://agentcommunity.org/mcp",
        timeout=10.0,
    ) as client:
        stats = await client.community_stats()
except AgentCommunityTransportError:
    # Connection, transport, or timeout failure.
    raise
except AgentCommunityProtocolError:
    # Lifecycle misuse or an invalid MCP response.
    raise
except AgentCommunityToolError:
    # The remote MCP tool returned an error result.
    raise

The endpoint must be an absolute HTTP(S) URL. The positive finite timeout covers connection and tool operations. There are no automatic retries in version 0.1.

Support policy

Python 3.10 and newer is supported. Runtime dependencies are deliberately bounded to compatible major versions: jsonschema>=4.20,<5, mcp>=2.1.1,<3, and pydantic>=2.12,<3. Only the latest 0.1 patch release receives security and compatibility fixes while the project is in its initial alpha series.

See the MCP documentation, project source, issue tracker, and security policy.

About

Official Python SDK for the Agent Community MCP endpoint

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages