# Step-by-step: Publish Kylas CRM MCP to the marketplace
Follow these steps in order. You need: a **PyPI account** (free), a **GitHub account**, and this repo on your machine.
---
## Part 1: Create a PyPI account (one-time)
1. Open: **https://pypi.org/account/register/**
2. Fill in:
- **Username** – choose a unique name (e.g. `akshaykylas94` or `akshay-kylas`). This will be your PyPI identity.
- **Password** – strong password
- **Confirm password**
- **Email** – e.g. `akshay.gunshetti@kylas.io`
3. Complete the CAPTCHA and click **Create account**.
4. Check your email and **verify your address** (click the link from PyPI).
5. *(Optional but recommended)* Create an API token for uploads:
- Go to **https://pypi.org/manage/account/token/**
- Click **Add API token**
- Token name: e.g. `mcp-upload`
- Scope: **Entire account** (or limit to a specific project later)
- Copy the token (starts with `pypi-`) and **save it somewhere safe**. You won’t see it again.
---
## Part 2: Upload the package to PyPI
Do this from your project folder on your computer.
### Step 1: Open Terminal
- On Mac: **Terminal** (or Cursor’s integrated terminal).
- Go to the project folder:
```bash
cd /Users/admin/Documents/MCP
```
### Step 2: Install upload tool
**If you're in a virtual environment** (e.g. you see `(.venv)` in your prompt):
```bash
pip install twine
```
**If you're not using a venv:**
```bash
python3 -m pip install --user twine
```
Do **not** use `--user` when inside a venv (you’ll get an error).
### Step 3: Upload the package
Use **your PyPI username and password** (or the API token as password and `__token__` as username).
```bash
twine upload dist/*
```
If `twine` is not found (e.g. you're in a venv and it’s only installed there), run:
```bash
python3 -m twine upload dist/*
```
- **Username:** your PyPI username (e.g. `akshaykylas94`), or `__token__` if using a token.
- **Password:** your PyPI password, or the token value (e.g. `pypi-...`) if using a token.
If the upload succeeds, you’ll see something like:
```
Uploading distributions to https://upload.pypi.org/legacy/
Uploading kylas_crm_mcp-1.0.0-py3-none-any.whl
Uploading kylas_crm_mcp-1.0.0.tar.gz
Successfully uploaded ...
```
### Step 4: Confirm on PyPI
- Open **https://pypi.org/project/kylas-crm-mcp/**
- You should see **kylas-crm-mcp** with version **1.0.0**.
---
## Part 3: Install the MCP Publisher (one-time)
The MCP Registry uses a small CLI tool to log in and publish.
### On Mac (with Homebrew)
```bash
brew install mcp-publisher
```
### If you don’t use Homebrew
1. Open: **https://github.com/modelcontextprotocol/registry/releases**
2. Download the latest **mcp-publisher** for your OS (e.g. `mcp-publisher_*_darwin_arm64.tar.gz` for Mac M1/M2).
3. Unzip and move the binary to your PATH, e.g.:
```bash
tar -xzf mcp-publisher_*.tar.gz
sudo mv mcp-publisher /usr/local/bin/
```
### Check it works
```bash
mcp-publisher --help
```
You should see commands like `init`, `login`, `publish`.
---
## Part 4: Log in to the MCP Registry with GitHub
This links the Registry to your GitHub identity (so the server name `io.github.akshaykylas94/kylas-crm` is allowed).
1. In Terminal, from the project folder:
```bash
cd /Users/admin/Documents/MCP
mcp-publisher login github
```
2. The tool will print a **code** (e.g. `ABCD-1234`) and a **URL** (e.g. https://github.com/login/device).
3. Open that URL in your browser.
4. Enter the code and approve the app.
5. Back in Terminal you should see something like: **Successfully logged in**.
---
## Part 5: Publish to the MCP Registry
1. Still in the project folder:
```bash
cd /Users/admin/Documents/MCP
mcp-publisher publish
```
2. The tool reads `server.json` in the current directory and uploads metadata to the Registry.
3. Success looks like:
```
Publishing to https://registry.modelcontextprotocol.io...
✓ Successfully published
✓ Server io.github.akshaykylas94/kylas-crm version 1.0.0
```
---
## Part 6: Verify it’s on the marketplace
1. Search via API:
```bash
curl "https://registry.modelcontextprotocol.io/v0.1/servers?search=kylas-crm"
```
You should see your server in the JSON.
2. Or check in an MCP client (e.g. Cursor): look for **Kylas CRM** or **io.github.akshaykylas94/kylas-crm** in the list of available MCP servers (if your client uses the Registry).
---
## Quick checklist
- [ ] PyPI account created and email verified
- [ ] (Optional) PyPI API token created and saved
- [ ] `twine upload dist/*` run successfully
- [ ] Package visible at https://pypi.org/project/kylas-crm-mcp/
- [ ] `mcp-publisher` installed
- [ ] `mcp-publisher login github` completed
- [ ] `mcp-publisher publish` completed
- [ ] Server appears in Registry search
---
## If something goes wrong
| Problem | What to do |
|--------|------------|
| **“Invalid or expired Registry JWT token”** | Run `mcp-publisher login github` again and complete the browser flow. |
| **“Registry validation failed for package”** | Wait 1–2 minutes after uploading to PyPI, then run `mcp-publisher publish` again. The Registry checks PyPI for the `mcp-name` in your README. |
| **“You do not have permission to publish this server”** | Your GitHub login must match: server name in `server.json` is `io.github.akshaykylas94/kylas-crm`. If your GitHub username is different, say so and we can change the config. |
| **twine: “Invalid credentials”** | Use the correct PyPI username and password (or `__token__` + API token). Ensure your email is verified on PyPI. |
| **“Package name already taken” on PyPI** | Someone else owns `kylas-crm-mcp`. Use a different name (e.g. `kylas-crm-mcp-leads`) and we’ll need to update `server.json` and `pyproject.toml` to match. |
---
## Summary: commands in order
```bash
# 1. Go to project
cd /Users/admin/Documents/MCP
# 2. Install twine (if not already)
python3 -m pip install --user twine
# 3. Upload to PyPI (use your PyPI username + password or token)
twine upload dist/*
# 4. Install MCP publisher (Mac with Homebrew)
brew install mcp-publisher
# 5. Log in to MCP Registry (opens browser for GitHub)
mcp-publisher login github
# 6. Publish to marketplace
mcp-publisher publish
```
After step 6, your server is on the MCP marketplace.