Skip to main content

Struct-MCP

Transform data structure definitions into queryable MCP servers. Define your data structures with business context and get an AI-queryable interface that can answer questions about field meanings, data lineage, and structure.

Quick Start

# Install
pip install struct-mcp

# Create a structure definition
echo "cheese_inventory:
  description: 'Artisanal cheese catalog'
  fields:
    cheese_id:
      type: string
      description: 'Unique identifier for each cheese'
      upstream_table: 'inventory.raw_cheese_data'
    name:
      type: string
      description: 'Display name of the cheese'
    stinkiness_level:
      type: integer
      nullable: true
      description: 'Stinkiness rating from 1-10'
" > cheese.yaml

# Start MCP server
struct-mcp serve cheese.yaml

Supported Formats

Load from multiple input formats:

  • YAML - Primary format with full business context
  • JSON Schema - Standard JSON Schema files
  • OpenSearch - Elasticsearch/OpenSearch mappings
  • Avro - Apache Avro schemas
  • Pydantic - Python BaseModel classes
  • Protocol Buffer - .proto message definitions
struct-mcp serve schema.yaml        # YAML
struct-mcp serve schema.json        # JSON Schema/OpenSearch/Avro
struct-mcp serve model.py          # Pydantic
struct-mcp serve messages.proto    # Protocol Buffer

What You Can Ask

Once loaded, query your structures with natural language:

  • "What does the cheese_id field represent?"
  • "Which fields come from the inventory table?"
  • "What fields are nullable and why?"
  • "How is stinkiness_level calculated?"
  • "Show me all array fields"

Python API

from struct_mcp import StructMCP, MCPServer

# Load any format
smc = StructMCP.from_file("cheese.yaml")

# Query programmatically
fields = smc.get_fields("cheese_inventory")
nullable_fields = smc.get_fields("cheese_inventory", nullable=True)

# Convert between formats
opensearch_mapping = smc.to_opensearch()
pydantic_model = smc.to_pydantic()

# Start MCP server
server = MCPServer(smc)
server.start()

Examples

See examples/ for sample files in all supported formats:

  • cheese_catalog.yaml - Artisanal cheese inventory
  • user_profiles.yaml - User data with preferences
  • financial_transactions.yaml - Payment processing metadata

Documentation

For detailed setup, development, and API documentation, see setup.md.

License

MIT

Metadata

Release files for struct-mcp 0.1.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 struct-mcp 0.1.0
File Size Uploaded Provenance
struct_mcp-0.1.0.tar.gz 82.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for struct-mcp 0.1.0
File Interpreter ABI Platform
struct_mcp-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 109.4 kB

Release files / struct_mcp-0.1.0.tar.gz

Download URL struct_mcp-0.1.0.tar.gz
Size 82.4 kB
Tags Source
SHA-256 checksum
How to use checksums
c73bb3fca0186ba1a6f9fef74b0666e6ace7a68f91e9e3d57f6c8cb49f35584a
BLAKE2b-256 checksum
How to use checksums
ff0cf7d6af68963dadff49bb6f7e828b35183494c58deb4e7305a00a811378ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release files / struct_mcp-0.1.0-py3-none-any.whl

Download URL struct_mcp-0.1.0-py3-none-any.whl
Size 27.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dcfa9233be76920094b998d5eef489c0c2910827a4cea28295a9d1b686f0cd02
BLAKE2b-256 checksum
How to use checksums
3bdb40b1b49ea78a039fb1352f00814e0b1a87cc01b2737c76076edc94bd3be7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Security for struct-mcp 0.1.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.1.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