Skip to main content

A sample MCP server exposing a current-time hexagram lookup tool.

Project description

hexagram-mcp-server

A minimal, production-friendly sample MCP server project with PyPI publishing support.

Features

  • Minimal MCP server implementation
  • Tool + Resource examples
  • Modern Python packaging with pyproject.toml
  • Console entry point (hexagram-mcp-server)
  • Build and publish workflow for PyPI

Quick Start

  1. Create and activate a virtual environment.

  2. Install dependencies:

    pip install -e .[dev]
    
  3. Run the server:

    hexagram-mcp-server
    

Example MCP API

  • Tool: get_hexagram() -> str

Build Package

python -m build

After building, artifacts are generated in the dist/ directory.

Publish to PyPI

  1. Create a PyPI API token from your PyPI account.

  2. Configure your token (recommended):

    set PYPI_TOKEN=pypi-xxxxxxxxxxxxxxxx
    
  3. Upload:

    python -m twine upload -u __token__ -p %PYPI_TOKEN% dist/*
    

For TestPyPI, use:

python -m twine upload --repository-url https://test.pypi.org/legacy/ -u __token__ -p %PYPI_TOKEN% dist/*

Publish with GitHub Actions

This template includes .github/workflows/publish.yml and supports PyPI Trusted Publishing.

  1. Create your package on PyPI first.
  2. In PyPI project settings, configure a Trusted Publisher for your GitHub repository.
  3. Create a GitHub Release (published), then workflow will build and publish automatically.

If you prefer token-based upload in CI, you can replace the publish step with twine upload and store token in GitHub Secrets.

Notes Before Publishing

  • Update name, authors, and project URLs in pyproject.toml.

  • Ensure version is bumped before each release.

  • Verify package contents:

    python -m twine check dist/*
    

License

MIT

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

hexagram_mcp_server-0.1.1.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

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

hexagram_mcp_server-0.1.1-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file hexagram_mcp_server-0.1.1.tar.gz.

File metadata

  • Download URL: hexagram_mcp_server-0.1.1.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for hexagram_mcp_server-0.1.1.tar.gz
Algorithm Hash digest
SHA256 fec2c155c8dc2bef1b5c5ac5f433f83e2aa6ac9c77be988a74a927593c3db2bf
MD5 42d5addac49c3c67e8895a7689132a78
BLAKE2b-256 793b96127948bd1884b03005e8fa8e7e13eee37d0c77e35f94e939d46e3a9f8a

See more details on using hashes here.

File details

Details for the file hexagram_mcp_server-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: hexagram_mcp_server-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for hexagram_mcp_server-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1359af6644dec78a005873a537178ce81bad9f1b6e2f8baa8d5b11edc989e73a
MD5 cf7db468cee84d6617b87a58f19119c2
BLAKE2b-256 4356aead0c89da4c90ff5788b7a4de518481ba0e1a67ee2e27b1f639a197ca9e

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