Skip to main content

FedMCP Python Core

Python implementation of the Federal Model Context Protocol (FedMCP) v0.2.

Installation

pip install fedmcp

For development:

pip install -e ".[dev]"

Quick Start

Creating and Signing Artifacts

from uuid import uuid4
from fedmcp import Artifact, ArtifactType, LocalSigner

# Create an artifact
artifact = Artifact(
    type=ArtifactType.AGENT_RECIPE,
    workspaceId=uuid4(),
    jsonBody={
        "name": "Healthcare Diagnostic Agent",
        "version": "1.0.0",
        "capabilities": ["diagnose", "recommend", "monitor"]
    }
)

# Sign it
signer = LocalSigner()
jws_token = signer.sign(artifact)
print(f"Signed artifact: {jws_token[:50]}...")

Verifying Artifacts

from fedmcp import Verifier

# Create verifier and add public key
verifier = Verifier()
verifier.add_public_key(signer.get_key_id(), signer.private_key.public_key())

# Verify the artifact
verified_artifact = verifier.verify(jws_token)
print(f"Verified artifact ID: {verified_artifact.id}")

Using the Client

from fedmcp import FedMCPClient
import asyncio

async def main():
    client = FedMCPClient(
        base_url="http://localhost:8000",
        workspace_id=uuid4(),
        signer=LocalSigner()
    )
    
    # Create an artifact
    result = await client.create_artifact(
        artifact_type=ArtifactType.LLM_COMPLETION,
        json_body={
            "model": "gpt-4",
            "prompt": "Diagnose patient symptoms",
            "completion": "Based on the symptoms..."
        }
    )
    
    print(f"Created artifact: {result['id']}")
    client.close()

asyncio.run(main())

AWS KMS Integration

from fedmcp import KMSSigner, KMSVerifier

# Sign with KMS
kms_signer = KMSSigner(
    kms_key_id="arn:aws:kms:us-gov-west-1:123456789012:key/abc-123",
    region="us-gov-west-1"
)
jws_token = kms_signer.sign(artifact)

# Verify with KMS
kms_verifier = KMSVerifier(region="us-gov-west-1")
kms_verifier.add_kms_key(
    key_id=kms_signer.get_key_id(),
    kms_key_id="arn:aws:kms:us-gov-west-1:123456789012:key/abc-123"
)
verified = kms_verifier.verify(jws_token)

Artifact Types

Standard FedMCP artifact types:

  • SSP_FRAGMENT - System Security Plan fragments
  • POAM_TEMPLATE - Plan of Action & Milestones templates
  • AGENT_RECIPE - AI agent configurations
  • BASELINE_MODULE - Security baseline modules
  • AUDIT_SCRIPT - Audit automation scripts

Healthcare-specific types:

  • RAG_QUERY - Retrieval-augmented generation queries
  • LLM_COMPLETION - Language model completions
  • TOOL_INVOCATION - Tool/function call records

Testing

Run tests with pytest:

pytest

License

Apache 2.0 - See LICENSE file for details.

Metadata

Release files for fedmcp 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fedmcp 0.2.0
File Size Uploaded Provenance
fedmcp-0.2.0.tar.gz 10.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for fedmcp 0.2.0
File Interpreter ABI Platform
fedmcp-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 19.0 kB

Release files / fedmcp-0.2.0.tar.gz

Download URL fedmcp-0.2.0.tar.gz
Size 10.0 kB
Tags Source
SHA-256 checksum
How to use checksums
8ec80454d68fdaf5fd1bbae77107a0ffa83628b833fdf8ca9d82e5815d7a0b37
BLAKE2b-256 checksum
How to use checksums
fa28887a80aff2cbc9287e94cef107c7296ebeff6634666fa8bd1dfb8ea850e9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.5

Release files / fedmcp-0.2.0-py3-none-any.whl

Download URL fedmcp-0.2.0-py3-none-any.whl
Size 9.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c6a4878fedfa87893e31d594b7f7b4bfe6313e09610a0adccfc86b4e7e187c59
BLAKE2b-256 checksum
How to use checksums
981786c6678cd65118a1380a8022c290760fa456ebdc41b52dbc77436ff40e78
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.5

Security for fedmcp 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page