Skip to content

Commit 7e12530

Browse files
committed
Initial commit: MCP server for publishing guidance
0 parents  commit 7e12530

File tree

9 files changed

+394
-0
lines changed

9 files changed

+394
-0
lines changed

.github/workflows/publish-mcp.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Publish to MCP Registry
2+
3+
on:
4+
push:
5+
tags: ["v*"] # Triggers on version tags like v1.0.0
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
11+
permissions:
12+
id-token: write # Required for OIDC authentication
13+
contents: read
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v5
18+
19+
- name: Setup Python
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: "3.11"
23+
24+
- name: Install dependencies
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip install build twine
28+
29+
- name: Build package
30+
run: python -m build
31+
32+
- name: Publish to PyPI
33+
uses: pypa/gh-action-pypi-publish@release/v1
34+
with:
35+
password: ${{ secrets.PYPI_API_TOKEN }}
36+
37+
- name: Install MCP Publisher
38+
run: |
39+
curl -L "https://github.com/modelcontextprotocol/registry/releases/download/v1.0.0/mcp-publisher_1.0.0_$(uname -s | tr '[:upper:]' '[:lower:]')_$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/').tar.gz" | tar xz mcp-publisher
40+
41+
- name: Login to MCP Registry
42+
run: ./mcp-publisher login github-oidc
43+
44+
- name: Publish to MCP Registry
45+
run: ./mcp-publisher publish

.gitignore

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
pip-wheel-metadata/
24+
share/python-wheels/
25+
*.egg-info/
26+
.installed.cfg
27+
*.egg
28+
MANIFEST
29+
30+
# PyInstaller
31+
# Usually these files are written by a python script from a template
32+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
33+
*.manifest
34+
*.spec
35+
36+
# Installer logs
37+
pip-log.txt
38+
pip-delete-this-directory.txt
39+
40+
# Unit test / coverage reports
41+
htmlcov/
42+
.tox/
43+
.nox/
44+
.coverage
45+
.coverage.*
46+
.cache
47+
nosetests.xml
48+
coverage.xml
49+
*.cover
50+
*.py,cover
51+
.hypothesis/
52+
.pytest_cache/
53+
54+
# Translations
55+
*.mo
56+
*.pot
57+
58+
# Django stuff:
59+
*.log
60+
local_settings.py
61+
db.sqlite3
62+
db.sqlite3-journal
63+
64+
# Flask stuff:
65+
instance/
66+
.webassets-cache
67+
68+
# Scrapy stuff:
69+
.scrapy
70+
71+
# Sphinx documentation
72+
docs/_build/
73+
74+
# PyBuilder
75+
target/
76+
77+
# Jupyter Notebook
78+
.ipynb_checkpoints
79+
80+
# IPython
81+
profile_default/
82+
ipython_config.py
83+
84+
# pyenv
85+
.python-version
86+
87+
# pipenv
88+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
89+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
90+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
91+
# install all needed dependencies.
92+
#Pipfile.lock
93+
94+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
95+
__pypackages__/
96+
97+
# Celery stuff
98+
celerybeat-schedule
99+
celerybeat.pid
100+
101+
# SageMath parsed files
102+
*.sage.py
103+
104+
# Environments
105+
.env
106+
.venv
107+
env/
108+
venv/
109+
ENV/
110+
env.bak/
111+
venv.bak/
112+
113+
# Spyder project settings
114+
.spyderproject
115+
.spyproject
116+
117+
# Rope project settings
118+
.ropeproject
119+
120+
# mkdocs documentation
121+
/site
122+
123+
# mypy
124+
.mypy_cache/
125+
.dmypy.json
126+
dmypy.json
127+
128+
# Pyre type checker
129+
.pyre/
130+
131+
# macOS
132+
.DS_Store
133+
134+
# IDE
135+
.vscode/
136+
.idea/
137+
*.swp
138+
*.swo
139+
140+
# MCP Publisher
141+
mcp-publisher

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Your Name
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

Readme.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Publish MCP Server
2+
3+
A package to help you publish an MCP server!
4+
5+
This is an MCP server that contains a prompt the user can use to be able to have their client decide the best way to publish their MCP server. The server uses Python.
6+
7+
<!-- mcp-name: io.github.marlenezw/publish-mcp-server -->
8+
9+
## Features
10+
11+
- Provides expert guidance on MCP server publishing
12+
- Supports automated CI/CD workflows with GitHub Actions
13+
- Recommends best practices for publishing to the MCP registry
14+
15+
## Installation
16+
17+
```bash
18+
pip install publish-mcp-server
19+
```
20+
21+
## Usage
22+
23+
```bash
24+
publish-mcp-server
25+
```
26+
27+
Or run as a module:
28+
29+
```bash
30+
python -m publish_mcp_server
31+
```

__init__.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
"""Publish MCP Server - A tool to help publish MCP servers to the registry."""
2+
3+
__version__ = "1.0.0"
4+
__author__ = "Your Name"
5+
__email__ = "your.email@example.com"
6+
7+
from .publish_mcp_server import mcp, main
8+
9+
__all__ = ["mcp", "main"]

publish_mcp_server.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
from mcp.server.fastmcp import FastMCP
2+
3+
# Create the MCP server
4+
mcp = FastMCP("publish_mcp_server")
5+
6+
@mcp.prompt(name="publish_mcp_server_prompt",
7+
description="Prompt for an agent to publish an MCP server to the MCP Registry")
8+
def publish_mcp_server_prompt(server_name: str) -> str:
9+
"""Publish and MCP Sever to the MCP Registry"""
10+
11+
prompt = f"""Read https://raw.githubusercontent.com/modelcontextprotocol/registry/refs/heads/main/docs/guides/publishing/publish-server.md
12+
and https://raw.githubusercontent.com/modelcontextprotocol/registry/refs/heads/main/docs/guides/publishing/github-actions.md.
13+
Evaluate the best way to publish the {server_name} server to the registry (prefer automated CI flows over manual flows where possible),
14+
and implement that. If possible, validate the server.json against the $schema before telling the user you are done, using a proper
15+
json schema library or tool available on the user's machine. If you get stuck, guide the user through the parts of the publishing process
16+
they need to do (e.g. logging into the publisher CLI if doing manual pubishing).
17+
"""
18+
return prompt
19+
20+
def main():
21+
"""Main entry point for the server."""
22+
mcp.run()
23+
24+
if __name__ == "__main__":
25+
main()

pyproject.toml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
[build-system]
2+
requires = ["setuptools>=61.0", "wheel"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "publish-mcp-server"
7+
version = "1.0.0"
8+
description = "An MCP server that helps users publish their MCP servers to the registry"
9+
authors = [
10+
{name = "Marlene Mhangami", email = "marlenemhangami@gmail.com"},
11+
]
12+
readme = "README.md"
13+
license = {text = "MIT"}
14+
requires-python = ">=3.8"
15+
dependencies = [
16+
"fastmcp>=0.1.0",
17+
]
18+
keywords = ["mcp", "model-context-protocol", "server", "publishing"]
19+
classifiers = [
20+
"Development Status :: 4 - Beta",
21+
"Intended Audience :: Developers",
22+
"License :: OSI Approved :: MIT License",
23+
"Programming Language :: Python :: 3",
24+
"Programming Language :: Python :: 3.8",
25+
"Programming Language :: Python :: 3.9",
26+
"Programming Language :: Python :: 3.10",
27+
"Programming Language :: Python :: 3.11",
28+
"Programming Language :: Python :: 3.12",
29+
]
30+
31+
[project.urls]
32+
Homepage = "https://github.com/marlenezw/publish-mcp-server"
33+
Repository = "https://github.com/marlenezw/publish-mcp-server"
34+
Issues = "https://github.com/marlenezw/publish-mcp-server/issues"
35+
36+
[project.scripts]
37+
publish-mcp-server = "publish_mcp_server:main"
38+
39+
[tool.setuptools]
40+
packages = ["publish_mcp_server"]
41+
42+
[tool.setuptools.package-dir]
43+
publish_mcp_server = "."

server.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-07-09/server.schema.json",
3+
"name": "io.github.yourusername/publish-mcp-server",
4+
"description": "An MCP server that helps users publish their MCP servers to the registry",
5+
"status": "active",
6+
"repository": {
7+
"url": "https://github.com/yourusername/publish-mcp-server",
8+
"source": "github"
9+
},
10+
"version": "1.0.0",
11+
"packages": [
12+
{
13+
"registry_type": "pypi",
14+
"registry_base_url": "https://pypi.org",
15+
"identifier": "publish-mcp-server",
16+
"version": "1.0.0",
17+
"transport": {
18+
"type": "stdio"
19+
}
20+
}
21+
]
22+
}

0 commit comments

Comments
 (0)