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
-
Create and activate a virtual environment.
-
Install dependencies:
pip install -e .[dev]
-
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
-
Create a PyPI API token from your PyPI account.
-
Configure your token (recommended):
set PYPI_TOKEN=pypi-xxxxxxxxxxxxxxxx
-
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.
- Create your package on PyPI first.
- In PyPI project settings, configure a Trusted Publisher for your GitHub repository.
- 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 inpyproject.toml. -
Ensure version is bumped before each release.
-
Verify package contents:
python -m twine check dist/*
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fec2c155c8dc2bef1b5c5ac5f433f83e2aa6ac9c77be988a74a927593c3db2bf
|
|
| MD5 |
42d5addac49c3c67e8895a7689132a78
|
|
| BLAKE2b-256 |
793b96127948bd1884b03005e8fa8e7e13eee37d0c77e35f94e939d46e3a9f8a
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1359af6644dec78a005873a537178ce81bad9f1b6e2f8baa8d5b11edc989e73a
|
|
| MD5 |
cf7db468cee84d6617b87a58f19119c2
|
|
| BLAKE2b-256 |
4356aead0c89da4c90ff5788b7a4de518481ba0e1a67ee2e27b1f639a197ca9e
|