Say hello to user - Python MCP stdio server
Project description
Deploxy Python Quick Start
Deploxy is a REAL proxy for deploying Stdio MCP server to serverless platform.
This is the Python version of the Deploxy quick start example, built with fastMCP for simplified MCP server development.
What this guide covers
- Deploying your Python Stdio MCP Server to PyPI package with Deploxy.
- Transforming it into a secure, private MCP server.
- Keeping your source code safe while providing users with a lightweight proxy package to install.
Installation and Usage
Using uvx (recommended)
# Run directly without installation
uvx kgesh-kgesh-sam-hello-1-py
# Or install and run
uvx --from kgesh-kgesh-sam-hello-1-py say-hello
Using pip
pip install kgesh-kgesh-sam-hello-1-py
say-hello
Development
Prerequisites
- Python 3.8 or higher
- pip or uv
- fastMCP library
Setup
# Clone and enter the directory
cd quick-start-py
# Install dependencies
pip install -e .
# Or with uv
uv pip install -e .
Running locally
# Run the server directly
python -m quick_start_py.main
# Or using the installed script
say-hello
Deployment Steps
Step 1: Prepare Your Project
First, ensure your project is ready to be published as a standard PyPI package.
- Configure
pyproject.toml: Make sure yourpyproject.tomlhas the requiredname,version, andproject.scriptsproperties set correctly. - Build Your Project: Install dependencies and test your build.
pip install build python -m build
Step 2: Check your PyPI package
To understand the problem Deploxy solves, let's first publish the package the traditional way.
# Build and publish to PyPI
python -m build
twine upload dist/*
Now, go to your package's page on PyPI (https://pypi.org/project/YOUR_PACKAGE_NAME/) and you will see that all your source code is publicly visible.
Important: This step is for this quick start demonstration only. In a real production, you will skip this step entirely.
Step 3: Create and Configure .deploxy.json
-
Create the file
You have two options to create the
.deploxy.jsonfile.Option 1: Use the CLI
Run the following command in your project root:
npx @deploxy/cli init
Option 2: Use the Dashboard
Go to the Deploy new project to create a new project, then copy the generated JSON configuration into a
.deploxy.jsonfile in your project root. -
Add your Auth Token: Open the file and add your
authToken. If you don't have one, you can get it from the Tokens page.{ "authToken": "your-auth-token-here", "defaultDeployRegion": "us-east-1", "stdioArgsIndex": "--args", "mcpPath": "/mcp", "packageType": "py", "injectedEnv": {} }
Step 4: Deploy with Deploxy
Now, instead of twine upload, run the deploy command.
Note: If you completed Step 2 and published a version to PyPI, you must increment the
versionin yourpyproject.tomlbefore runningdeploy. Both PyPI and Deploxy require a new version for each deployment.
npx @deploxy/cli deploy
You can monitor the deployment status on the Deploxy Dashboard.
Once deployment is complete, check your package page on PyPI again. You will see that the code has been replaced with the Deploxy proxy client.
That's it! Your Python package is now deployed with Deploxy, keeping your source code private while providing a secure proxy for your users.
How It Works: The Deploxy Magic
When you deploy with Deploxy, you're not just publishing a package; you're creating a secure, private backend for your MCP server.
The code that end-users download and run via uvx is a lightweight proxy client. This proxy client takes user requests (like a ToolCall) and streams them to your actual MCP server, which is running securely in the serverless cloud.
Understanding the .deploxy.json properties
-
authToken: This is the token required to authenticate and deploy your package to Deploxy. -
defaultDeployRegion: This is the default AWS region where your MCP server will run if the end-user does not specify a particular region. To give your end-users the fastest experience, they can specify a region using the--regionflag when they run your package (uvx your-pkg --region us-east-1). If the flag is omitted, this default region is used.With the Deploxy Pro plan, the
--regionparameter is not needed. Requests are automatically routed to the nearest region for the end-user. -
stdioArgsIndex: This option specifies the arguments that are passed directly to your MCP server. For example, when an end-user runsuvx your-pkg --args user-api-key, your server can accessuser-api-keyfromsys.argv. -
injectedEnv: This is an object of environment variables that are accessible only within your MCP server (e.g.,os.getenv("DATABASE_URL")). These are completely hidden from the end-user because they only interact with the proxy client, not your secure server code. -
mcpPathandpackageType: You generally don't need to change these. For Python projects,packageTypeshould be"py".
Security Warning: The
.deploxy.jsonfile contains your sensitiveauthToken. Never commit this file to a public repository. Ensure it is listed in your.gitignorefile.
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 kgesh_sam_hello_1_py_pkg-0.0.1.tar.gz.
File metadata
- Download URL: kgesh_sam_hello_1_py_pkg-0.0.1.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
23ad6e14d75ef398641a9eec1240ef714a3c039f19ce7ccc931e02c13fb05d34
|
|
| MD5 |
bd9b5e672e87486c9e4ec07b7885d416
|
|
| BLAKE2b-256 |
4feb68de855f358f10540d9206932d32fd1352f72b750d24e43ce59ace7e7d9b
|
File details
Details for the file kgesh_sam_hello_1_py_pkg-0.0.1-py3-none-any.whl.
File metadata
- Download URL: kgesh_sam_hello_1_py_pkg-0.0.1-py3-none-any.whl
- Upload date:
- Size: 5.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7d2e98018e4d8c52c0b2c443d6ceb2995ec45d2001428d3ebea3c3034827320d
|
|
| MD5 |
9e04eedfafc9cc9870f618e4b7ddc6c7
|
|
| BLAKE2b-256 |
2b6ee961ca28c5e50a97343145137c7326a16ede052dc6f5857d4b3a1c53cd88
|