Skip to content

Commit bb03e3a

Browse files
authored
refactor!: split CLI and MCP server into separate distributions (#56)
* refactor!: split CLI and MCP server into separate distributions BREAKING CHANGE: CLI and MCP server are now separate packages. This implements TASK-001 to separate concerns: - `skillport` (CLI-only): SkillOps commands using filesystem as SSOT - `skillport-mcp` (server-only): MCP server with indexed search - `skillport-core` (library): shared logic, no console scripts Key changes: - CLI commands no longer depend on LanceDB indexes - New filesystem-based catalog for CLI (list, show, doc, validate) - Removed `search` and `serve` commands from CLI - Added lazy imports to avoid loading indexing deps in CLI - MCP server remains the sole index builder - Dependency boundary tests to prevent regressions Install separately: - `pip install skillport` for CLI only - `pip install skillport-mcp` for MCP server * fix: resolve hatchling build issues for subpackages - Remove relative readme paths that don't work with hatchling - Add empty skillport_mcp package for wheel build requirement - Update sdist include paths * ci: update release workflow for 3-package publish Build and publish all distributions in order: 1. skillport-core (dependency for others) 2. skillport (CLI) 3. skillport-mcp (MCP server)
1 parent 5e41fb2 commit bb03e3a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+955
-1032
lines changed

.github/workflows/release.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,18 @@ jobs:
4242
- name: Set up uv
4343
uses: astral-sh/setup-uv@v5
4444

45-
- name: Build distributions (sdist/wheel)
46-
run: uv build
45+
- name: Build all distributions (3 packages)
46+
run: |
47+
# Build order matters: skillport-core first (others depend on it)
48+
uv build --package skillport-core --out-dir dist/
49+
uv build --package skillport --out-dir dist/
50+
uv build --package skillport-mcp --out-dir dist/
4751
4852
- name: Publish to PyPI
4953
uses: pypa/gh-action-pypi-publish@release/v1
5054
with:
5155
print-hash: true
56+
# Publishes all packages in dist/
5257

5358
# snapshot-docs:
5459
# needs: release-please

AGENTS.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
## 2. Project Context
1515
### Architecture
1616
* **Brand**: SkillPort
17-
* **Package & CLI**: `skillport` (legacy alias: `skillport-mcp`)
18-
* **Type**: MCP Server (Model Context Protocol)
17+
* **Packages**: `skillport` (CLI), `skillport-mcp` (MCP server), `skillport-core` (shared lib)
18+
* **Type**: CLI + MCP Server (Model Context Protocol)
1919
* **Stack**:
2020
* **Runtime**: Python 3.10+
2121
* **Package Manager**: `uv`
@@ -24,7 +24,7 @@
2424
* **Config**: `pydantic-settings`
2525

2626
### Directory Structure
27-
* `src/skillport/`: Source code (modular monolith)
27+
* `packages/skillport-core/src/skillport/`: Source code (modular monolith)
2828
* `interfaces/cli/`: Typer CLI adapter
2929
* `interfaces/mcp/`: FastMCP server adapter
3030
* `modules/skills/`: Skill management public/internal APIs
@@ -42,7 +42,7 @@ To act autonomously, always verify changes using these commands:
4242
* **Install/Sync**: `uv sync`
4343
* **Run Server (Manual)**:
4444
```bash
45-
SKILLPORT_SKILLS_DIR=.agent/skills SKILLPORT_EMBEDDING_PROVIDER=none uv run skillport
45+
SKILLPORT_SKILLS_DIR=.agent/skills SKILLPORT_EMBEDDING_PROVIDER=none uv run python -m skillport.interfaces.mcp.cli
4646
```
4747
* **Verify Functionality (Critical)**:
4848
```bash

README.md

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ Choose your setup:
6868

6969
### 1. Install
7070

71-
> **Skip this step** if you only want to serve an existing skills directory via MCP.
71+
> **Note (CLI/MCP split):** The CLI (`skillport`) and MCP server (`skillport-mcp`) are separate install paths.
7272
73-
Install to manage skills and use them without MCP:
73+
Install the lightweight CLI (SkillOps):
7474

7575
```bash
7676
uv tool install skillport
@@ -80,7 +80,16 @@ uv tool install skillport
8080
uv tool upgrade skillport
8181
```
8282

83-
Enables `add`, `update`, `remove`, `validate`, `search`, `show`, and `doc` (generate AGENTS.md for non-MCP agents).
83+
Enables `add`, `update`, `remove`, `validate`, `list`, `show`, and `doc` (generate AGENTS.md for non-MCP agents).
84+
85+
Install the MCP server (indexing + search):
86+
87+
```bash
88+
uv tool install skillport-mcp
89+
# or: pip install skillport-mcp
90+
91+
uv tool upgrade skillport-mcp
92+
```
8493

8594
### 2. Add Skills
8695

@@ -108,30 +117,30 @@ skillport --skills-dir ~/.codex/skills add anthropics/skills skills/frontend-des
108117
109118
**Cursor** (one-click)
110119

111-
[![Install MCP Server](https://cursor.com/deeplink/mcp-install-dark.svg)](cursor://anysphere.cursor-deeplink/mcp/install?name=skillport&config=eyJjb21tYW5kIjoidXZ4IiwiYXJncyI6WyJza2lsbHBvcnQiXSwiZW52Ijp7IlNLSUxMUE9SVF9TS0lMTFNfRElSIjoifi8uc2tpbGxwb3J0L3NraWxscyJ9fQ==)
120+
[![Install MCP Server](https://cursor.com/deeplink/mcp-install-dark.svg)](cursor://anysphere.cursor-deeplink/mcp/install?name=skillport&config=eyJjb21tYW5kIjoidXZ4IiwiYXJncyI6WyJza2lsbHBvcnQtbWNwIl0sImVudiI6eyJTS0lMTFBPUlRfU0tJTExTX0RJUiI6In4vLnNraWxscG9ydC9za2lsbHMifX0=)
112121

113122
**VS Code / GitHub Copilot** (one-click)
114123

115-
[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install_MCP_Server-007ACC?logo=visualstudiocode)](https://insiders.vscode.dev/redirect/mcp/install?name=skillport&config=%7B%22command%22%3A%22uvx%22%2C%22args%22%3A%5B%22skillport%22%5D%2C%22env%22%3A%7B%22SKILLPORT_SKILLS_DIR%22%3A%22~/.skillport/skills%22%7D%7D)
124+
[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install_MCP_Server-007ACC?logo=visualstudiocode)](https://insiders.vscode.dev/redirect/mcp/install?name=skillport&config=%7B%22command%22%3A%22uvx%22%2C%22args%22%3A%5B%22skillport-mcp%22%5D%2C%22env%22%3A%7B%22SKILLPORT_SKILLS_DIR%22%3A%22~/.skillport/skills%22%7D%7D)
116125

117126
**Kiro** (one-click)
118127

119-
[![Add to Kiro](https://kiro.dev/images/add-to-kiro.svg)](https://kiro.dev/launch/mcp/add?name=skillport&config=%7B%22command%22%3A%22uvx%22%2C%22args%22%3A%5B%22skillport%22%5D%2C%22env%22%3A%7B%22SKILLPORT_SKILLS_DIR%22%3A%22~/.skillport/skills%22%7D%2C%22disabled%22%3Afalse%2C%22autoApprove%22%3A%5B%5D%7D)
128+
[![Add to Kiro](https://kiro.dev/images/add-to-kiro.svg)](https://kiro.dev/launch/mcp/add?name=skillport&config=%7B%22command%22%3A%22uvx%22%2C%22args%22%3A%5B%22skillport-mcp%22%5D%2C%22env%22%3A%7B%22SKILLPORT_SKILLS_DIR%22%3A%22~/.skillport/skills%22%7D%2C%22disabled%22%3Afalse%2C%22autoApprove%22%3A%5B%5D%7D)
120129

121130
**CLI Agents**
122131

123132
```bash
124133
# Codex
125-
codex mcp add skillport -- uvx skillport
134+
codex mcp add skillport -- uvx skillport-mcp
126135

127136
# With custom skills in the project directory
128-
codex mcp add skillport --env SKILLPORT_SKILLS_DIR=./.agent/skills -- uvx skillport
137+
codex mcp add skillport --env SKILLPORT_SKILLS_DIR=./.agent/skills -- uvx skillport-mcp
129138

130139
# Claude Code
131-
claude mcp add skillport -- uvx skillport
140+
claude mcp add skillport -- uvx skillport-mcp
132141

133142
# With custom skills directory
134-
claude mcp add skillport --env SKILLPORT_SKILLS_DIR=~/.claude/skills -- uvx skillport
143+
claude mcp add skillport --env SKILLPORT_SKILLS_DIR=~/.claude/skills -- uvx skillport-mcp
135144
```
136145

137146
**Other MCP Clients** (Windsurf, Cline, Roo Code, Antigravity, etc.)
@@ -143,7 +152,7 @@ Add to your client's MCP config file:
143152
"mcpServers": {
144153
"skillport": {
145154
"command": "uvx",
146-
"args": ["skillport"],
155+
"args": ["skillport-mcp"],
147156
"env": { "SKILLPORT_SKILLS_DIR": "~/.skillport/skills" }
148157
}
149158
}
@@ -166,7 +175,7 @@ Add to `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS)
166175
"mcpServers": {
167176
"skillport": {
168177
"command": "uvx",
169-
"args": ["skillport"],
178+
"args": ["skillport-mcp"],
170179
"env": { "SKILLPORT_SKILLS_DIR": "~/.skillport/skills" }
171180
}
172181
}
@@ -256,9 +265,9 @@ skillport --skills-dir ./skills add hello-world
256265
**Search & Load:**
257266

258267
```bash
259-
skillport search <query> # Find skills by description
260268
skillport show <id> # View skill details and instructions
261269
```
270+
For discovery/search, use MCP tools (`search_skills`, `load_skill`) via the MCP server.
262271

263272
**Install from GitHub:**
264273

@@ -318,7 +327,7 @@ Expose different skills to different AI agents:
318327
"mcpServers": {
319328
"skillport-development": {
320329
"command": "uvx",
321-
"args": ["skillport"],
330+
"args": ["skillport-mcp"],
322331
"env": { "SKILLPORT_ENABLED_CATEGORIES": "development,testing" }
323332
}
324333
}
@@ -331,7 +340,7 @@ Expose different skills to different AI agents:
331340
"mcpServers": {
332341
"writing-skills": {
333342
"command": "uvx",
334-
"args": ["skillport"],
343+
"args": ["skillport-mcp"],
335344
"env": { "SKILLPORT_ENABLED_CATEGORIES": "writing,research" }
336345
}
337346
}
@@ -446,7 +455,7 @@ Instructions for the AI agent.
446455
git clone https://github.com/gotalab/skillport.git
447456
cd skillport
448457
uv sync
449-
SKILLPORT_SKILLS_DIR=.agent/skills uv run skillport serve
458+
SKILLPORT_SKILLS_DIR=.agent/skills uv run skillport-mcp
450459
```
451460

452461
## License

guide/cli.md

Lines changed: 33 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# CLI Reference
22

3-
SkillPort provides a command-line interface for managing [Agent Skills](https://docs.anthropic.com/en/docs/agents-and-tools/agent-skills/overview) and running the MCP server.
3+
SkillPort provides a command-line interface for managing [Agent Skills](https://docs.anthropic.com/en/docs/agents-and-tools/agent-skills/overview).
4+
5+
The MCP server (indexed search) is provided as a separate command/package: `skillport-mcp`.
46

57
## Table of Contents
68

@@ -10,12 +12,12 @@ SkillPort provides a command-line interface for managing [Agent Skills](https://
1012
- [add](#skillport-add) - Add skills
1113
- [update](#skillport-update) - Update skills
1214
- [list](#skillport-list) - List installed skills
13-
- [search](#skillport-search) - Search skills
1415
- [show](#skillport-show) - Show skill details
1516
- [remove](#skillport-remove) - Remove skills
1617
- [validate](#skillport-validate) - Validate skills
17-
- [serve](#skillport-serve) - Start MCP server
1818
- [doc](#skillport-doc) - Generate AGENTS.md
19+
- [MCP Server](#mcp-server)
20+
- [skillport-mcp](#skillport-mcp) - Start MCP server
1921
- [Exit Codes](#exit-codes)
2022
- [Configuration](#configuration)
2123

@@ -25,21 +27,20 @@ SkillPort provides a command-line interface for managing [Agent Skills](https://
2527
skillport <command> [options]
2628

2729
# Global overrides (CLI > env > default)
28-
skillport --skills-dir ./skills --db-path ./index.lancedb add hello-world
30+
skillport --skills-dir ./skills add hello-world
2931
# Place global flags before the subcommand (e.g., skillport --skills-dir ... add ...)
3032
```
3133

32-
> **Note**: `skillport-mcp` is a legacy alias for `skillport`. Both work identically.
34+
> **Note:** `skillport` is CLI-only. Use `skillport-mcp` to run the MCP server.
3335
3436
### Global options (all commands)
3537

3638
| Option | Description | Notes |
3739
|--------|-------------|-------|
3840
| `--skills-dir` | Override skills directory path | Applies to all commands in the invocation |
39-
| `--db-path` | Override LanceDB path | Use together with `--skills-dir` to keep index in sync |
40-
| `--auto-reindex/--no-auto-reindex` | Control automatic index rebuilding | Default: enabled; respects `SKILLPORT_AUTO_REINDEX` env var |
41+
| (none) | Index settings | Index settings are MCP-server-only (`skillport-mcp`) |
4142

42-
Precedence: CLI flag > environment variable (`SKILLPORT_SKILLS_DIR` / `SKILLPORT_DB_PATH`) > default (`~/.skillport/skills`, `~/.skillport/indexes/default/skills.lancedb`).
43+
Precedence: CLI flag > environment variable (`SKILLPORT_SKILLS_DIR`) > default (`~/.skillport/skills`).
4344

4445
## Commands
4546

@@ -55,8 +56,7 @@ skillport init [options]
5556

5657
1. Creates `.skillportrc` configuration file
5758
2. Creates skills directory if it doesn't exist
58-
3. Builds the skill index
59-
4. Updates instruction files (AGENTS.md, etc.) with skills table
59+
3. Updates instruction files (AGENTS.md, etc.) with skills table
6060

6161
#### Options
6262

@@ -501,33 +501,15 @@ skillport list --json
501501

502502
---
503503

504-
### skillport search
504+
### Search (MCP only)
505505

506-
Search for skills.
506+
`skillport search` is not provided in the CLI.
507507

508-
```bash
509-
skillport search <query> [options]
510-
```
508+
For discovery, run the MCP server (`skillport-mcp`) and use MCP tools:
509+
- `search_skills(query)`
510+
- `load_skill(skill_id)`
511511

512-
#### Options
513-
514-
| Option | Description | Default |
515-
|--------|-------------|---------|
516-
| `--limit`, `-n` | Maximum results | `10` |
517-
| `--json` | Output as JSON | `false` |
518-
519-
#### Examples
520-
521-
```bash
522-
# Search by description
523-
skillport search "PDF text extraction"
524-
525-
# Limit results
526-
skillport search "code review" --limit 5
527-
528-
# JSON output
529-
skillport search "testing" --json
530-
```
512+
For local browsing without MCP, use `skillport list` + `skillport show <id>`.
531513

532514
---
533515

@@ -604,8 +586,8 @@ skillport validate [target] [options]
604586

605587
| Type | Example | Description |
606588
|------|---------|-------------|
607-
| (none) | `skillport validate` | Validate all skills in index |
608-
| Skill ID | `skillport validate hello-world` | Validate specific skill from index |
589+
| (none) | `skillport validate` | Validate all skills in skills directory |
590+
| Skill ID | `skillport validate hello-world` | Validate specific skill by ID |
609591
| Path (skill) | `skillport validate ./my-skill/` | Validate single skill directory |
610592
| Path (dir) | `skillport validate ./skills/` | Validate all skills in directory |
611593

@@ -698,12 +680,14 @@ skillport validate
698680

699681
---
700682

701-
### skillport serve
683+
## MCP Server
684+
685+
### skillport-mcp
702686

703-
Start the MCP server.
687+
Start the MCP server (indexed search).
704688

705689
```bash
706-
skillport serve [options]
690+
skillport-mcp [options]
707691
```
708692

709693
#### Options
@@ -720,40 +704,25 @@ skillport serve [options]
720704

721705
| Mode | Command | Tools |
722706
|------|---------|-------|
723-
| **Local** (stdio) | `skillport serve` | `search_skills`, `load_skill` |
724-
| **Remote** (HTTP) | `skillport serve --http` | + `read_skill_file` |
707+
| **Local** (stdio) | `skillport-mcp` | `search_skills`, `load_skill` |
708+
| **Remote** (HTTP) | `skillport-mcp --http` | + `read_skill_file` |
725709

726710
#### Examples
727711

728712
```bash
729713
# Local mode (stdio) - for Claude Code, Cursor
730-
skillport serve
714+
skillport-mcp
731715

732716
# Remote mode (HTTP) - for network access
733-
skillport serve --http
717+
skillport-mcp --http
734718

735719
# Remote mode with custom host/port
736-
skillport serve --http --host 0.0.0.0 --port 8000
720+
skillport-mcp --http --host 0.0.0.0 --port 8000
737721

738722
# Start with forced reindex
739-
skillport serve --reindex
740-
```
741-
742-
#### Local vs Remote Mode
743-
744-
- **Local Mode (stdio)**: Agent has direct file access. `read_skill_file` is not needed.
745-
- **Remote Mode (HTTP)**: Agent accesses remotely. Use `read_skill_file` to fetch files.
746-
747-
#### Legacy Mode
748-
749-
```bash
750-
# The following are equivalent (backward compatible)
751-
skillport
752-
skillport serve
723+
skillport-mcp --reindex
753724
```
754725

755-
> **Note**: `skillport --reindex` is **not supported**. Always use `skillport serve --reindex`.
756-
757726
---
758727

759728
### skillport doc
@@ -906,10 +875,10 @@ For full configuration options, see [Configuration Guide](configuration.md).
906875

907876
### Quick Reference
908877

909-
CLI commands resolve `skills_dir` / `db_path` in this order:
878+
CLI commands resolve `skills_dir` in this order:
910879

911-
1. **CLI flags**`--skills-dir`, `--db-path`
912-
2. **Environment variables**`SKILLPORT_SKILLS_DIR`, `SKILLPORT_DB_PATH`
880+
1. **CLI flags**`--skills-dir`
881+
2. **Environment variables**`SKILLPORT_SKILLS_DIR`
913882
3. **Project config**`.skillportrc` or `pyproject.toml [tool.skillport]`
914883
4. **Default**`~/.skillport/skills`
915884

@@ -918,7 +887,7 @@ CLI commands resolve `skills_dir` / `db_path` in this order:
918887
| Variable | Description |
919888
|----------|-------------|
920889
| `SKILLPORT_SKILLS_DIR` | Skills directory |
921-
| `SKILLPORT_AUTO_REINDEX` | Enable/disable automatic reindexing |
890+
| (MCP server) `SKILLPORT_DB_PATH` | Index location (used by `skillport-mcp`) |
922891

923892
### GitHub Authentication
924893

0 commit comments

Comments
 (0)