Skip to content
This repository was archived by the owner on Mar 24, 2025. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: modelcontextprotocol/create-python-server
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.0.3
Choose a base ref
...
head repository: modelcontextprotocol/create-python-server
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
  • 10 commits
  • 6 files changed
  • 3 contributors

Commits on Nov 21, 2024

  1. bump

    dsp-ant committed Nov 21, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    6e43668 View commit details
  2. Copy the full SHA
    6559948 View commit details
  3. v1.0.4

    dsp-ant committed Nov 21, 2024
    Copy the full SHA
    b56d4c5 View commit details
  4. bump

    dsp-ant committed Nov 21, 2024
    Copy the full SHA
    a40b42b View commit details
  5. update readme

    dsp-ant committed Nov 21, 2024
    Copy the full SHA
    e5c6c63 View commit details

Commits on Nov 24, 2024

  1. Move template to flat app pattern

    dsp-ant committed Nov 24, 2024
    Copy the full SHA
    35730e4 View commit details
  2. 1.0.5

    dsp-ant committed Nov 24, 2024
    Copy the full SHA
    446072a View commit details
  3. bump

    dsp-ant committed Nov 24, 2024
    Copy the full SHA
    7d921b9 View commit details

Commits on Nov 25, 2024

  1. Create CONTRIBUTING.md

    jspahrsummers committed Nov 25, 2024
    Copy the full SHA
    40083e7 View commit details
  2. Merge pull request #4 from modelcontextprotocol/justin/contributing

    Create CONTRIBUTING.md
    jspahrsummers authored Nov 25, 2024
    Copy the full SHA
    b07744d View commit details
Showing with 228 additions and 159 deletions.
  1. +43 −0 CONTRIBUTING.md
  2. +1 −1 pyproject.toml
  3. +3 −2 src/create_mcp_server/__init__.py
  4. +54 −4 src/create_mcp_server/template/README.md.jinja2
  5. +126 −151 src/create_mcp_server/template/server.py.jinja2
  6. +1 −1 uv.lock
43 changes: 43 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Contributing

Thank you for your interest in contributing to `create-mcp-server`! This tool helps developers quickly scaffold new MCP (Model Context Protocol) servers.

## Getting Started

1. Fork the repository
2. Clone your fork: `git clone https://github.com/YOUR_USERNAME/create-python-server.git`
3. Install dependencies: `uv sync --dev --all-extras`

## Development

- Make your changes in the `src` directory
- Test your changes by creating a new server: `uv run -m create_mcp_server test-server`
- Run type checking: `uv run pyright`
- Run linting: `uv run ruff check .`

## Pull Requests

1. Create a new branch for your changes
2. Make your changes
3. Ensure type checking and linting pass
4. Test server creation using your changes
5. Submit a pull request with a clear description of your changes

## Code of Conduct

This project follows our [Code of Conduct](CODE_OF_CONDUCT.md). Please review it before contributing.

## Reporting Issues

- Use the [GitHub issue tracker](https://github.com/modelcontextprotocol/create-python-server/issues)
- Provide clear reproduction steps
- Include relevant system information
- Specify the version you're using

## Security Issues

Please review our [Security Policy](SECURITY.md) for reporting security vulnerabilities.

## License

By contributing, you agree that your contributions will be licensed under the MIT License.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "create-mcp-server"
version = "1.0.3"
version = "1.0.6.dev0"
description = "Create an Model Context Protocol server project from a template."
readme = "README.md"
requires-python = ">=3.10"
5 changes: 3 additions & 2 deletions src/create_mcp_server/__init__.py
Original file line number Diff line number Diff line change
@@ -24,6 +24,7 @@ def first_binary(self) -> str | None:
scripts = self.data["project"].get("scripts", {})
return next(iter(scripts.keys()), None)


def check_uv_version(required_version: str) -> str | None:
"""Check if uv is installed and has minimum version"""
try:
@@ -255,8 +256,6 @@ def check_package_name(name: str) -> bool:
return True




@click.command()
@click.option(
"--path",
@@ -341,6 +340,8 @@ def main(
click.echo("❌ Error: Invalid path. Project creation aborted.", err=True)
return 1

project_path = project_path.resolve()

create_project(project_path, name, description, version, claudeapp)
update_pyproject_settings(project_path, version, description)

58 changes: 54 additions & 4 deletions src/create_mcp_server/template/README.md.jinja2
Original file line number Diff line number Diff line change
@@ -24,14 +24,22 @@ The server implements one tool:
- Takes "name" and "content" as required string arguments
- Updates server state and notifies clients of resource changes

## Install
## Configuration

### Claude Desktop
[TODO: Add configuration details specific to your implementation]

## Quickstart

### Install

#### Claude Desktop

On MacOS: `~/Library/Application\ Support/Claude/claude_desktop_config.json`
On Windows: `%APPDATA%/Claude/claude_desktop_config.json`

```
<details>
<summary>Development/Unpublished Servers Configuration</summary>
```
"mcpServers": {
"{{server_name}}": {
"command": "uv",
@@ -43,9 +51,51 @@ On Windows: `%APPDATA%/Claude/claude_desktop_config.json`
]
}
}
```
</details>

<details>
<summary>Published Servers Configuration</summary>
```
"mcpServers": {
"{{server_name}}": {
"command": "uvx",
"args": [
"{{server_name}}"
]
}
}
```
</details>

## Development

### Building and Publishing

To prepare the package for distribution:

1. Sync dependencies and update lockfile:
```bash
uv sync
```

2. Build package distributions:
```bash
uv build
```

This will create source and wheel distributions in the `dist/` directory.

3. Publish to PyPI:
```bash
uv publish
```

## Develop and Debug
Note: You'll need to set PyPI credentials via environment variables or command flags:
- Token: `--token` or `UV_PUBLISH_TOKEN`
- Or username/password: `--username`/`UV_PUBLISH_USERNAME` and `--password`/`UV_PUBLISH_PASSWORD`

### Debugging

Since MCP servers run over stdio, debugging can be challenging. For the best debugging
experience, we strongly recommend using the [MCP Inspector](https://github.com/modelcontextprotocol/inspector).
Loading