mcp-creator-python 1.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mcp_creator/__init__.py +1 -0
- mcp_creator/server.py +202 -0
- mcp_creator/services/__init__.py +0 -0
- mcp_creator/services/codegen.py +593 -0
- mcp_creator/services/file_writer.py +39 -0
- mcp_creator/services/pypi_client.py +55 -0
- mcp_creator/services/subprocess_runner.py +51 -0
- mcp_creator/tools/__init__.py +0 -0
- mcp_creator/tools/add_tool.py +94 -0
- mcp_creator/tools/build_package.py +50 -0
- mcp_creator/tools/check_pypi_name.py +37 -0
- mcp_creator/tools/check_setup.py +104 -0
- mcp_creator/tools/creator_profile.py +106 -0
- mcp_creator/tools/generate_launchguide.py +95 -0
- mcp_creator/tools/publish_package.py +72 -0
- mcp_creator/tools/scaffold_server.py +122 -0
- mcp_creator/tools/setup_github.py +137 -0
- mcp_creator/transport.py +11 -0
- mcp_creator_python-1.0.0.dist-info/METADATA +117 -0
- mcp_creator_python-1.0.0.dist-info/RECORD +22 -0
- mcp_creator_python-1.0.0.dist-info/WHEEL +4 -0
- mcp_creator_python-1.0.0.dist-info/entry_points.txt +2 -0
mcp_creator/__init__.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""MCP Creator — create, build, and publish Python MCP servers to PyPI."""
|
mcp_creator/server.py
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
"""MCP Creator — create, build, and publish Python MCP servers to PyPI."""
|
|
2
|
+
|
|
3
|
+
from mcp.server.fastmcp import FastMCP
|
|
4
|
+
|
|
5
|
+
from mcp_creator.tools.creator_profile import get_creator_profile as _get_creator_profile
|
|
6
|
+
from mcp_creator.tools.creator_profile import update_creator_profile as _update_creator_profile
|
|
7
|
+
from mcp_creator.tools.check_setup import check_setup as _check_setup
|
|
8
|
+
from mcp_creator.tools.check_pypi_name import check_pypi_name as _check_pypi_name
|
|
9
|
+
from mcp_creator.tools.scaffold_server import scaffold_server as _scaffold_server
|
|
10
|
+
from mcp_creator.tools.add_tool import add_tool as _add_tool
|
|
11
|
+
from mcp_creator.tools.build_package import build_package as _build_package
|
|
12
|
+
from mcp_creator.tools.publish_package import publish_package as _publish_package
|
|
13
|
+
from mcp_creator.tools.setup_github import setup_github as _setup_github
|
|
14
|
+
from mcp_creator.tools.generate_launchguide import generate_launchguide as _generate_launchguide
|
|
15
|
+
|
|
16
|
+
mcp = FastMCP("mcp-creator")
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
@mcp.tool(
|
|
20
|
+
description=(
|
|
21
|
+
"Load the creator's persistent profile — their setup status, GitHub/PyPI usernames, "
|
|
22
|
+
"and project history. Call this FIRST in every session. If the profile exists with "
|
|
23
|
+
"setup_complete=true, skip all onboarding and go straight to building."
|
|
24
|
+
)
|
|
25
|
+
)
|
|
26
|
+
def get_creator_profile() -> str:
|
|
27
|
+
"""Load creator profile."""
|
|
28
|
+
return _get_creator_profile()
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
@mcp.tool(
|
|
32
|
+
description=(
|
|
33
|
+
"Update the creator's profile after setup steps or project creation. "
|
|
34
|
+
"Call this after: setup completes, a project is published, or GitHub/PyPI info is learned. "
|
|
35
|
+
"This persists across sessions so the user never repeats setup."
|
|
36
|
+
)
|
|
37
|
+
)
|
|
38
|
+
def update_creator_profile(
|
|
39
|
+
setup_complete: bool | None = None,
|
|
40
|
+
github_username: str | None = None,
|
|
41
|
+
pypi_username: str | None = None,
|
|
42
|
+
default_output_dir: str | None = None,
|
|
43
|
+
add_project: str | None = None,
|
|
44
|
+
) -> str:
|
|
45
|
+
"""Update creator profile."""
|
|
46
|
+
return _update_creator_profile(
|
|
47
|
+
setup_complete=setup_complete,
|
|
48
|
+
github_username=github_username,
|
|
49
|
+
pypi_username=pypi_username,
|
|
50
|
+
default_output_dir=default_output_dir,
|
|
51
|
+
add_project=add_project,
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
@mcp.tool(
|
|
56
|
+
description=(
|
|
57
|
+
"Check the user's environment for required tools (uv, git, gh CLI, PyPI token). "
|
|
58
|
+
"Call this after get_creator_profile if setup_complete is false. "
|
|
59
|
+
"If everything is set up, skip beginner instructions and go straight to building."
|
|
60
|
+
)
|
|
61
|
+
)
|
|
62
|
+
def check_setup() -> str:
|
|
63
|
+
"""Check what's already set up."""
|
|
64
|
+
return _check_setup()
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
@mcp.tool(
|
|
68
|
+
description="Check if a package name is available on PyPI. Call this first before scaffolding."
|
|
69
|
+
)
|
|
70
|
+
def check_pypi_name(package_name: str) -> str:
|
|
71
|
+
"""Check PyPI name availability."""
|
|
72
|
+
return _check_pypi_name(package_name=package_name)
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
@mcp.tool(
|
|
76
|
+
description=(
|
|
77
|
+
"Scaffold a complete, runnable MCP server project. "
|
|
78
|
+
"Pass the package name, description, and a JSON array of tool definitions. "
|
|
79
|
+
"Each tool def: {name, description, parameters: [{name, type, required, description, default}], returns}. "
|
|
80
|
+
"The generated server runs immediately with stub implementations. "
|
|
81
|
+
"Set paid=true to add license key gating via the MCP Marketplace SDK. "
|
|
82
|
+
"Set paid_tools to a JSON array of tool names to gate (omit to gate all). "
|
|
83
|
+
'Set hosting="remote" for an SSE/HTTP server with Dockerfile (default: "local" for stdio).'
|
|
84
|
+
)
|
|
85
|
+
)
|
|
86
|
+
def scaffold_server(
|
|
87
|
+
package_name: str,
|
|
88
|
+
description: str,
|
|
89
|
+
tools: str,
|
|
90
|
+
output_dir: str = ".",
|
|
91
|
+
env_vars: str | None = None,
|
|
92
|
+
paid: bool = False,
|
|
93
|
+
paid_tools: str | None = None,
|
|
94
|
+
hosting: str = "local",
|
|
95
|
+
) -> str:
|
|
96
|
+
"""Scaffold a complete MCP server project."""
|
|
97
|
+
return _scaffold_server(
|
|
98
|
+
package_name=package_name,
|
|
99
|
+
description=description,
|
|
100
|
+
tools=tools,
|
|
101
|
+
output_dir=output_dir,
|
|
102
|
+
env_vars=env_vars,
|
|
103
|
+
paid=paid,
|
|
104
|
+
paid_tools=paid_tools,
|
|
105
|
+
hosting=hosting,
|
|
106
|
+
)
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
@mcp.tool(
|
|
110
|
+
description=(
|
|
111
|
+
"Add a new tool to an existing scaffolded MCP server. "
|
|
112
|
+
"Pass the project directory and a JSON tool definition. "
|
|
113
|
+
"Creates the tool module, service stub, test, and updates server.py."
|
|
114
|
+
)
|
|
115
|
+
)
|
|
116
|
+
def add_tool(project_dir: str, tool: str) -> str:
|
|
117
|
+
"""Add a tool to an existing project."""
|
|
118
|
+
return _add_tool(project_dir=project_dir, tool=tool)
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
@mcp.tool(
|
|
122
|
+
description="Build the MCP server package using 'uv build'. Run this after implementing your tools."
|
|
123
|
+
)
|
|
124
|
+
def build_package(project_dir: str) -> str:
|
|
125
|
+
"""Build the package."""
|
|
126
|
+
return _build_package(project_dir=project_dir)
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
@mcp.tool(
|
|
130
|
+
description=(
|
|
131
|
+
"Publish the built package to PyPI using 'uv publish'. "
|
|
132
|
+
"Requires a PyPI token — either pass it directly or set UV_PUBLISH_TOKEN env var."
|
|
133
|
+
)
|
|
134
|
+
)
|
|
135
|
+
def publish_package(project_dir: str, token: str | None = None) -> str:
|
|
136
|
+
"""Publish to PyPI."""
|
|
137
|
+
return _publish_package(project_dir=project_dir, token=token)
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
@mcp.tool(
|
|
141
|
+
description=(
|
|
142
|
+
"Initialize git, create a GitHub repo, and push the project. "
|
|
143
|
+
"Requires the gh CLI to be installed and authenticated. "
|
|
144
|
+
"Run this after publishing to PyPI so the repo URL can be included in the LAUNCHGUIDE."
|
|
145
|
+
)
|
|
146
|
+
)
|
|
147
|
+
def setup_github(
|
|
148
|
+
project_dir: str,
|
|
149
|
+
repo_name: str,
|
|
150
|
+
description: str = "",
|
|
151
|
+
private: bool = False,
|
|
152
|
+
) -> str:
|
|
153
|
+
"""Create GitHub repo and push code."""
|
|
154
|
+
return _setup_github(
|
|
155
|
+
project_dir=project_dir,
|
|
156
|
+
repo_name=repo_name,
|
|
157
|
+
description=description,
|
|
158
|
+
private=private,
|
|
159
|
+
)
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
@mcp.tool(
|
|
163
|
+
description=(
|
|
164
|
+
"Generate a LAUNCHGUIDE.md for MCP Marketplace submission. "
|
|
165
|
+
"Creates a formatted file ready to submit at mcp-marketplace.io. "
|
|
166
|
+
"Limits: tagline max 100 chars, features max 30 items, tags max 30."
|
|
167
|
+
)
|
|
168
|
+
)
|
|
169
|
+
def generate_launchguide(
|
|
170
|
+
project_dir: str,
|
|
171
|
+
package_name: str,
|
|
172
|
+
tagline: str,
|
|
173
|
+
description: str,
|
|
174
|
+
category: str,
|
|
175
|
+
features: str,
|
|
176
|
+
tools_summary: str,
|
|
177
|
+
tags: str,
|
|
178
|
+
setup_requirements: str = "No environment variables required.",
|
|
179
|
+
docs_url: str = "",
|
|
180
|
+
) -> str:
|
|
181
|
+
"""Generate LAUNCHGUIDE.md."""
|
|
182
|
+
return _generate_launchguide(
|
|
183
|
+
project_dir=project_dir,
|
|
184
|
+
package_name=package_name,
|
|
185
|
+
tagline=tagline,
|
|
186
|
+
description=description,
|
|
187
|
+
category=category,
|
|
188
|
+
features=features,
|
|
189
|
+
tools_summary=tools_summary,
|
|
190
|
+
tags=tags,
|
|
191
|
+
setup_requirements=setup_requirements,
|
|
192
|
+
docs_url=docs_url,
|
|
193
|
+
)
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
def main():
|
|
197
|
+
"""Run the MCP Creator server."""
|
|
198
|
+
mcp.run()
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
if __name__ == "__main__":
|
|
202
|
+
main()
|
|
File without changes
|