label-image-mcp 0.1.0__tar.gz
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.
- label_image_mcp-0.1.0/.github/workflows/ci.yml +20 -0
- label_image_mcp-0.1.0/.github/workflows/release.yml +83 -0
- label_image_mcp-0.1.0/.gitignore +4 -0
- label_image_mcp-0.1.0/.mcpbignore +7 -0
- label_image_mcp-0.1.0/LICENSE +21 -0
- label_image_mcp-0.1.0/PKG-INFO +141 -0
- label_image_mcp-0.1.0/PUBLISHING.md +37 -0
- label_image_mcp-0.1.0/README.md +114 -0
- label_image_mcp-0.1.0/glama.json +4 -0
- label_image_mcp-0.1.0/manifest.json +71 -0
- label_image_mcp-0.1.0/pyproject.toml +58 -0
- label_image_mcp-0.1.0/server.json +43 -0
- label_image_mcp-0.1.0/src/label_image_mcp/__init__.py +1 -0
- label_image_mcp-0.1.0/src/label_image_mcp/agent.py +84 -0
- label_image_mcp-0.1.0/src/label_image_mcp/client.py +103 -0
- label_image_mcp-0.1.0/src/label_image_mcp/exporters.py +110 -0
- label_image_mcp-0.1.0/src/label_image_mcp/server.py +191 -0
- label_image_mcp-0.1.0/tests/test_metadata.py +32 -0
- label_image_mcp-0.1.0/tests/test_server.py +147 -0
- label_image_mcp-0.1.0/uv.lock +2775 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
test:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
strategy:
|
|
12
|
+
matrix:
|
|
13
|
+
python-version: ["3.11", "3.13"]
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v4
|
|
16
|
+
- uses: astral-sh/setup-uv@v5
|
|
17
|
+
with:
|
|
18
|
+
python-version: ${{ matrix.python-version }}
|
|
19
|
+
- run: uv sync --extra agent
|
|
20
|
+
- run: uv run pytest -q
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
# Push a tag like v0.1.0 (matching the version in pyproject.toml, server.json
|
|
4
|
+
# and manifest.json) to publish to PyPI and the MCP Registry, and attach the
|
|
5
|
+
# Claude Desktop extension (.mcpb) to a GitHub release.
|
|
6
|
+
on:
|
|
7
|
+
push:
|
|
8
|
+
tags: ["v*"]
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
build:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v4
|
|
15
|
+
- uses: astral-sh/setup-uv@v5
|
|
16
|
+
- name: Check tag matches package version
|
|
17
|
+
run: |
|
|
18
|
+
version=$(uv version --short)
|
|
19
|
+
if [ "v$version" != "$GITHUB_REF_NAME" ]; then
|
|
20
|
+
echo "Tag $GITHUB_REF_NAME does not match version $version" >&2
|
|
21
|
+
exit 1
|
|
22
|
+
fi
|
|
23
|
+
- run: uv sync --extra agent
|
|
24
|
+
- run: uv run pytest -q
|
|
25
|
+
- run: uv build
|
|
26
|
+
- uses: actions/setup-node@v4
|
|
27
|
+
with:
|
|
28
|
+
node-version: 22
|
|
29
|
+
- run: npx -y @anthropic-ai/mcpb pack . dist-mcpb/label-image-mcp.mcpb
|
|
30
|
+
- uses: actions/upload-artifact@v4
|
|
31
|
+
with:
|
|
32
|
+
name: dist
|
|
33
|
+
path: |
|
|
34
|
+
dist/
|
|
35
|
+
dist-mcpb/
|
|
36
|
+
|
|
37
|
+
pypi:
|
|
38
|
+
needs: build
|
|
39
|
+
runs-on: ubuntu-latest
|
|
40
|
+
environment: pypi
|
|
41
|
+
permissions:
|
|
42
|
+
id-token: write # PyPI trusted publishing
|
|
43
|
+
steps:
|
|
44
|
+
- uses: actions/download-artifact@v4
|
|
45
|
+
with:
|
|
46
|
+
name: dist
|
|
47
|
+
- uses: pypa/gh-action-pypi-publish@release/v1
|
|
48
|
+
with:
|
|
49
|
+
packages-dir: dist/
|
|
50
|
+
|
|
51
|
+
mcp-registry:
|
|
52
|
+
needs: pypi
|
|
53
|
+
runs-on: ubuntu-latest
|
|
54
|
+
permissions:
|
|
55
|
+
id-token: write # GitHub OIDC login for the io.github.sachinbkale27 namespace
|
|
56
|
+
contents: read
|
|
57
|
+
steps:
|
|
58
|
+
- uses: actions/checkout@v4
|
|
59
|
+
- name: Install mcp-publisher
|
|
60
|
+
run: |
|
|
61
|
+
curl -sL "https://github.com/modelcontextprotocol/registry/releases/latest/download/mcp-publisher_linux_amd64.tar.gz" | tar xz mcp-publisher
|
|
62
|
+
- name: Publish to MCP Registry
|
|
63
|
+
run: |
|
|
64
|
+
./mcp-publisher login github-oidc
|
|
65
|
+
# The registry verifies the package on PyPI, which can take a minute to appear
|
|
66
|
+
for attempt in 1 2 3 4 5; do
|
|
67
|
+
./mcp-publisher publish && exit 0
|
|
68
|
+
sleep 30
|
|
69
|
+
done
|
|
70
|
+
exit 1
|
|
71
|
+
|
|
72
|
+
github-release:
|
|
73
|
+
needs: build
|
|
74
|
+
runs-on: ubuntu-latest
|
|
75
|
+
permissions:
|
|
76
|
+
contents: write
|
|
77
|
+
steps:
|
|
78
|
+
- uses: actions/download-artifact@v4
|
|
79
|
+
with:
|
|
80
|
+
name: dist
|
|
81
|
+
- run: gh release create "$GITHUB_REF_NAME" dist-mcpb/label-image-mcp.mcpb dist/* --repo "$GITHUB_REPOSITORY" --generate-notes
|
|
82
|
+
env:
|
|
83
|
+
GH_TOKEN: ${{ github.token }}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Sachin Kale
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: label-image-mcp
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: MCP server and LangGraph agent for the Image Label annotation app (labels.sachin-kale.com)
|
|
5
|
+
Project-URL: Homepage, https://labels.sachin-kale.com/mcp
|
|
6
|
+
Project-URL: Source, https://github.com/sachinbkale27/label-image-mcp
|
|
7
|
+
Project-URL: Issues, https://github.com/sachinbkale27/label-image-mcp/issues
|
|
8
|
+
Author: Sachin Kale
|
|
9
|
+
License-Expression: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: coco,histopathology,image-annotation,langgraph,mcp,model-context-protocol,yolo
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Intended Audience :: Science/Research
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Topic :: Scientific/Engineering :: Image Recognition
|
|
16
|
+
Requires-Python: >=3.10
|
|
17
|
+
Requires-Dist: httpx>=0.27
|
|
18
|
+
Requires-Dist: mcp<2,>=1.24
|
|
19
|
+
Requires-Dist: pillow>=10.0
|
|
20
|
+
Requires-Dist: pydantic>=2.0
|
|
21
|
+
Provides-Extra: agent
|
|
22
|
+
Requires-Dist: langchain-anthropic>=1.0; extra == 'agent'
|
|
23
|
+
Requires-Dist: langchain-mcp-adapters>=0.3; extra == 'agent'
|
|
24
|
+
Requires-Dist: langchain>=1.4; extra == 'agent'
|
|
25
|
+
Requires-Dist: langgraph>=1.2; extra == 'agent'
|
|
26
|
+
Description-Content-Type: text/markdown
|
|
27
|
+
|
|
28
|
+
# Image Label MCP server
|
|
29
|
+
|
|
30
|
+
<!-- mcp-name: io.github.sachinbkale27/label-image-mcp -->
|
|
31
|
+
|
|
32
|
+
An [MCP](https://modelcontextprotocol.io) server for [Image Label](https://labels.sachin-kale.com),
|
|
33
|
+
a free image annotation tool. It lets Claude and other AI assistants list and upload your images,
|
|
34
|
+
add or clean up annotations, and export COCO or YOLO training data. A LangGraph agent is included.
|
|
35
|
+
|
|
36
|
+
Use cases and setup guide: https://labels.sachin-kale.com/mcp
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
LangGraph agent (label-image-agent) Claude Desktop / Claude Code / any MCP client
|
|
40
|
+
│ langchain-mcp-adapters │
|
|
41
|
+
└──────────────┬──────────────────────┘
|
|
42
|
+
▼
|
|
43
|
+
label-image-mcp (stdio or HTTP)
|
|
44
|
+
│
|
|
45
|
+
▼
|
|
46
|
+
Image Label API (/api/images ...)
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Account
|
|
50
|
+
|
|
51
|
+
Uploading and saving annotations needs an Image Label account
|
|
52
|
+
([request one](https://labels.sachin-kale.com/contact)). Without one, the tools can read but not
|
|
53
|
+
save. Only images saved to your account are visible. Work kept only in your browser is not.
|
|
54
|
+
|
|
55
|
+
## Install
|
|
56
|
+
|
|
57
|
+
**Claude Desktop:** download `label-image-mcp.mcpb` from the
|
|
58
|
+
[latest release](https://github.com/sachinbkale27/label-image-mcp/releases/latest), open it, and
|
|
59
|
+
enter your username and password when asked.
|
|
60
|
+
|
|
61
|
+
**Claude Code:**
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
claude mcp add label-image -e LABEL_USERNAME=... -e LABEL_PASSWORD=... -- uvx label-image-mcp
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
**Any MCP client** (needs [uv](https://docs.astral.sh/uv/)):
|
|
68
|
+
|
|
69
|
+
```json
|
|
70
|
+
{
|
|
71
|
+
"mcpServers": {
|
|
72
|
+
"label-image": {
|
|
73
|
+
"command": "uvx",
|
|
74
|
+
"args": ["label-image-mcp"],
|
|
75
|
+
"env": { "LABEL_USERNAME": "...", "LABEL_PASSWORD": "..." }
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Configuration
|
|
82
|
+
|
|
83
|
+
| Variable | Default | Purpose |
|
|
84
|
+
|---|---|---|
|
|
85
|
+
| `LABEL_USERNAME` / `LABEL_PASSWORD` | unset | Account credentials. Without them requests are anonymous and read-only in practice |
|
|
86
|
+
| `LABEL_API_URL` | `https://labels.sachin-kale.com/api` | API base URL, for another deployment or `sam local start-api` |
|
|
87
|
+
|
|
88
|
+
## Tools
|
|
89
|
+
|
|
90
|
+
| Tool | What it does |
|
|
91
|
+
|---|---|
|
|
92
|
+
| `list_images(category?)` | Image summaries with annotation counts |
|
|
93
|
+
| `get_image(image_id)` | Metadata, annotations and a signed viewing URL |
|
|
94
|
+
| `update_image_metadata(image_id, name?, category?, sub_category?, description?)` | Edit image details |
|
|
95
|
+
| `add_annotations(image_id, annotations)` | Append pins, polygons, circles, rectangles or arrows |
|
|
96
|
+
| `replace_annotations(image_id, annotations)` | Replace all annotations |
|
|
97
|
+
| `remove_annotations(image_id, annotation_ids)` | Remove annotations by id |
|
|
98
|
+
| `upload_image(path, name?, category?, description?)` | Upload a local image file |
|
|
99
|
+
| `export_annotations(image_id, format)` | COCO JSON or YOLO, same output as the web app's export |
|
|
100
|
+
|
|
101
|
+
There is deliberately no tool for deleting images.
|
|
102
|
+
|
|
103
|
+
## HTTP mode
|
|
104
|
+
|
|
105
|
+
`label-image-mcp --http [--host 127.0.0.1] [--port 8765]` serves Streamable HTTP at
|
|
106
|
+
`http://HOST:PORT/mcp`, so several clients can share one running server:
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
claude mcp add --transport http label-image http://127.0.0.1:8765/mcp
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## LangGraph agent
|
|
113
|
+
|
|
114
|
+
A terminal chat agent that uses these tools. The graph is `START → agent ⇄ tools`, with
|
|
115
|
+
conversation memory kept for the session.
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
uv tool install "label-image-mcp[agent]"
|
|
119
|
+
export ANTHROPIC_API_KEY=... LABEL_USERNAME=... LABEL_PASSWORD=...
|
|
120
|
+
label-image-agent
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
| Variable | Default | Purpose |
|
|
124
|
+
|---|---|---|
|
|
125
|
+
| `LABEL_AGENT_MODEL` | `anthropic:claude-sonnet-5-5` | Model as `provider:model`, e.g. `openai:gpt-4.1` or `ollama:llama3.1` (install `langchain-openai` / `langchain-ollama`) |
|
|
126
|
+
| `LABEL_MCP_URL` | unset | Connect to a running HTTP server instead of starting one |
|
|
127
|
+
|
|
128
|
+
## Development
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
uv sync --extra agent
|
|
132
|
+
uv run pytest
|
|
133
|
+
npx @modelcontextprotocol/inspector uv run label-image-mcp
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
In the Image Label app repo, `./start.sh` runs this server in HTTP mode next to the web app.
|
|
137
|
+
It reads credentials from `mcp-server/.env`. Releases are described in [PUBLISHING.md](PUBLISHING.md).
|
|
138
|
+
|
|
139
|
+
## License
|
|
140
|
+
|
|
141
|
+
MIT
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Publishing
|
|
2
|
+
|
|
3
|
+
The source of truth is `mcp-server/` in the private `label-image` repo. The public repo
|
|
4
|
+
`sachinbkale27/label-image-mcp` gets that folder's history via `git subtree`:
|
|
5
|
+
|
|
6
|
+
```bash
|
|
7
|
+
# from the label-image repo root
|
|
8
|
+
git subtree push --prefix mcp-server mcp-public main
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
(`mcp-public` is a git remote pointing at https://github.com/sachinbkale27/label-image-mcp.git)
|
|
12
|
+
|
|
13
|
+
## One-time setup
|
|
14
|
+
|
|
15
|
+
1. **PyPI trusted publisher:** on https://pypi.org/manage/account/publishing/ add a pending
|
|
16
|
+
publisher: project `label-image-mcp`, owner `sachinbkale27`, repo `label-image-mcp`,
|
|
17
|
+
workflow `release.yml`, environment `pypi`.
|
|
18
|
+
2. **GitHub environment:** in the public repo, Settings → Environments → create `pypi`.
|
|
19
|
+
3. **MCP Registry:** nothing to set up. The release workflow logs in with GitHub OIDC, which
|
|
20
|
+
owns the `io.github.sachinbkale27/*` namespace.
|
|
21
|
+
|
|
22
|
+
## Release
|
|
23
|
+
|
|
24
|
+
1. Bump the version in `pyproject.toml`, `server.json` (both `version` fields) and
|
|
25
|
+
`manifest.json`. `tests/test_metadata.py` fails if they disagree.
|
|
26
|
+
2. Push with `git subtree push` (above), then tag the public repo:
|
|
27
|
+
`git tag v0.1.1 && git push mcp-public v0.1.1`, or create the tag on GitHub.
|
|
28
|
+
3. The `Release` workflow tests, publishes to PyPI, publishes `server.json` to the MCP Registry,
|
|
29
|
+
and attaches the `.mcpb` Claude Desktop extension to a GitHub release.
|
|
30
|
+
|
|
31
|
+
## Directories (one-time, manual)
|
|
32
|
+
|
|
33
|
+
- **Glama** (https://glama.ai/mcp/servers): indexes public GitHub repos. `glama.json` claims the
|
|
34
|
+
listing for `sachinbkale27`.
|
|
35
|
+
- **Smithery** (https://smithery.ai): add the server from the public GitHub repo on the site.
|
|
36
|
+
- **mcp.so** (https://mcp.so/submit) and **PulseMCP** (https://www.pulsemcp.com/submit): submit
|
|
37
|
+
the GitHub URL. PulseMCP also imports from the MCP Registry.
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
# Image Label MCP server
|
|
2
|
+
|
|
3
|
+
<!-- mcp-name: io.github.sachinbkale27/label-image-mcp -->
|
|
4
|
+
|
|
5
|
+
An [MCP](https://modelcontextprotocol.io) server for [Image Label](https://labels.sachin-kale.com),
|
|
6
|
+
a free image annotation tool. It lets Claude and other AI assistants list and upload your images,
|
|
7
|
+
add or clean up annotations, and export COCO or YOLO training data. A LangGraph agent is included.
|
|
8
|
+
|
|
9
|
+
Use cases and setup guide: https://labels.sachin-kale.com/mcp
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
LangGraph agent (label-image-agent) Claude Desktop / Claude Code / any MCP client
|
|
13
|
+
│ langchain-mcp-adapters │
|
|
14
|
+
└──────────────┬──────────────────────┘
|
|
15
|
+
▼
|
|
16
|
+
label-image-mcp (stdio or HTTP)
|
|
17
|
+
│
|
|
18
|
+
▼
|
|
19
|
+
Image Label API (/api/images ...)
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Account
|
|
23
|
+
|
|
24
|
+
Uploading and saving annotations needs an Image Label account
|
|
25
|
+
([request one](https://labels.sachin-kale.com/contact)). Without one, the tools can read but not
|
|
26
|
+
save. Only images saved to your account are visible. Work kept only in your browser is not.
|
|
27
|
+
|
|
28
|
+
## Install
|
|
29
|
+
|
|
30
|
+
**Claude Desktop:** download `label-image-mcp.mcpb` from the
|
|
31
|
+
[latest release](https://github.com/sachinbkale27/label-image-mcp/releases/latest), open it, and
|
|
32
|
+
enter your username and password when asked.
|
|
33
|
+
|
|
34
|
+
**Claude Code:**
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
claude mcp add label-image -e LABEL_USERNAME=... -e LABEL_PASSWORD=... -- uvx label-image-mcp
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
**Any MCP client** (needs [uv](https://docs.astral.sh/uv/)):
|
|
41
|
+
|
|
42
|
+
```json
|
|
43
|
+
{
|
|
44
|
+
"mcpServers": {
|
|
45
|
+
"label-image": {
|
|
46
|
+
"command": "uvx",
|
|
47
|
+
"args": ["label-image-mcp"],
|
|
48
|
+
"env": { "LABEL_USERNAME": "...", "LABEL_PASSWORD": "..." }
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Configuration
|
|
55
|
+
|
|
56
|
+
| Variable | Default | Purpose |
|
|
57
|
+
|---|---|---|
|
|
58
|
+
| `LABEL_USERNAME` / `LABEL_PASSWORD` | unset | Account credentials. Without them requests are anonymous and read-only in practice |
|
|
59
|
+
| `LABEL_API_URL` | `https://labels.sachin-kale.com/api` | API base URL, for another deployment or `sam local start-api` |
|
|
60
|
+
|
|
61
|
+
## Tools
|
|
62
|
+
|
|
63
|
+
| Tool | What it does |
|
|
64
|
+
|---|---|
|
|
65
|
+
| `list_images(category?)` | Image summaries with annotation counts |
|
|
66
|
+
| `get_image(image_id)` | Metadata, annotations and a signed viewing URL |
|
|
67
|
+
| `update_image_metadata(image_id, name?, category?, sub_category?, description?)` | Edit image details |
|
|
68
|
+
| `add_annotations(image_id, annotations)` | Append pins, polygons, circles, rectangles or arrows |
|
|
69
|
+
| `replace_annotations(image_id, annotations)` | Replace all annotations |
|
|
70
|
+
| `remove_annotations(image_id, annotation_ids)` | Remove annotations by id |
|
|
71
|
+
| `upload_image(path, name?, category?, description?)` | Upload a local image file |
|
|
72
|
+
| `export_annotations(image_id, format)` | COCO JSON or YOLO, same output as the web app's export |
|
|
73
|
+
|
|
74
|
+
There is deliberately no tool for deleting images.
|
|
75
|
+
|
|
76
|
+
## HTTP mode
|
|
77
|
+
|
|
78
|
+
`label-image-mcp --http [--host 127.0.0.1] [--port 8765]` serves Streamable HTTP at
|
|
79
|
+
`http://HOST:PORT/mcp`, so several clients can share one running server:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
claude mcp add --transport http label-image http://127.0.0.1:8765/mcp
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## LangGraph agent
|
|
86
|
+
|
|
87
|
+
A terminal chat agent that uses these tools. The graph is `START → agent ⇄ tools`, with
|
|
88
|
+
conversation memory kept for the session.
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
uv tool install "label-image-mcp[agent]"
|
|
92
|
+
export ANTHROPIC_API_KEY=... LABEL_USERNAME=... LABEL_PASSWORD=...
|
|
93
|
+
label-image-agent
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
| Variable | Default | Purpose |
|
|
97
|
+
|---|---|---|
|
|
98
|
+
| `LABEL_AGENT_MODEL` | `anthropic:claude-sonnet-5-5` | Model as `provider:model`, e.g. `openai:gpt-4.1` or `ollama:llama3.1` (install `langchain-openai` / `langchain-ollama`) |
|
|
99
|
+
| `LABEL_MCP_URL` | unset | Connect to a running HTTP server instead of starting one |
|
|
100
|
+
|
|
101
|
+
## Development
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
uv sync --extra agent
|
|
105
|
+
uv run pytest
|
|
106
|
+
npx @modelcontextprotocol/inspector uv run label-image-mcp
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
In the Image Label app repo, `./start.sh` runs this server in HTTP mode next to the web app.
|
|
110
|
+
It reads credentials from `mcp-server/.env`. Releases are described in [PUBLISHING.md](PUBLISHING.md).
|
|
111
|
+
|
|
112
|
+
## License
|
|
113
|
+
|
|
114
|
+
MIT
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
{
|
|
2
|
+
"manifest_version": "0.4",
|
|
3
|
+
"name": "label-image-mcp",
|
|
4
|
+
"display_name": "Image Label",
|
|
5
|
+
"version": "0.1.0",
|
|
6
|
+
"description": "Manage images and annotations in the Image Label app, and export COCO or YOLO datasets.",
|
|
7
|
+
"long_description": "Lets Claude list, upload and describe images saved in Image Label (labels.sachin-kale.com), add or clean up annotations, and export COCO or YOLO training data. Needs an Image Label account to upload or save annotations.",
|
|
8
|
+
"author": {
|
|
9
|
+
"name": "Sachin Kale",
|
|
10
|
+
"url": "https://labels.sachin-kale.com"
|
|
11
|
+
},
|
|
12
|
+
"homepage": "https://labels.sachin-kale.com/mcp",
|
|
13
|
+
"documentation": "https://github.com/sachinbkale27/label-image-mcp#readme",
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "https://github.com/sachinbkale27/label-image-mcp"
|
|
17
|
+
},
|
|
18
|
+
"server": {
|
|
19
|
+
"type": "uv",
|
|
20
|
+
"entry_point": "src/label_image_mcp/server.py",
|
|
21
|
+
"mcp_config": {
|
|
22
|
+
"command": "uv",
|
|
23
|
+
"args": ["run", "--directory", "${__dirname}", "label-image-mcp"],
|
|
24
|
+
"env": {
|
|
25
|
+
"LABEL_USERNAME": "${user_config.username}",
|
|
26
|
+
"LABEL_PASSWORD": "${user_config.password}",
|
|
27
|
+
"LABEL_API_URL": "${user_config.api_url}"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"user_config": {
|
|
32
|
+
"username": {
|
|
33
|
+
"type": "string",
|
|
34
|
+
"title": "Username",
|
|
35
|
+
"description": "Image Label account username. Leave empty for read-only access.",
|
|
36
|
+
"required": false
|
|
37
|
+
},
|
|
38
|
+
"password": {
|
|
39
|
+
"type": "string",
|
|
40
|
+
"title": "Password",
|
|
41
|
+
"description": "Image Label account password",
|
|
42
|
+
"sensitive": true,
|
|
43
|
+
"required": false
|
|
44
|
+
},
|
|
45
|
+
"api_url": {
|
|
46
|
+
"type": "string",
|
|
47
|
+
"title": "API URL",
|
|
48
|
+
"description": "Only change this to use a different deployment",
|
|
49
|
+
"default": "https://labels.sachin-kale.com/api",
|
|
50
|
+
"required": false
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"tools": [
|
|
54
|
+
{ "name": "list_images", "description": "List saved images, optionally filtered by category" },
|
|
55
|
+
{ "name": "get_image", "description": "Get an image's metadata, annotations and viewing URL" },
|
|
56
|
+
{ "name": "update_image_metadata", "description": "Update an image's name, category or description" },
|
|
57
|
+
{ "name": "add_annotations", "description": "Append annotations to an image" },
|
|
58
|
+
{ "name": "replace_annotations", "description": "Replace all annotations on an image" },
|
|
59
|
+
{ "name": "remove_annotations", "description": "Remove annotations by id" },
|
|
60
|
+
{ "name": "upload_image", "description": "Upload a local image file" },
|
|
61
|
+
{ "name": "export_annotations", "description": "Export annotations as COCO JSON or YOLO" }
|
|
62
|
+
],
|
|
63
|
+
"compatibility": {
|
|
64
|
+
"platforms": ["darwin", "linux", "win32"],
|
|
65
|
+
"runtimes": {
|
|
66
|
+
"python": ">=3.10"
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"keywords": ["image annotation", "coco", "yolo", "histopathology", "dataset"],
|
|
70
|
+
"license": "MIT"
|
|
71
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "label-image-mcp"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "MCP server and LangGraph agent for the Image Label annotation app (labels.sachin-kale.com)"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
license = "MIT"
|
|
7
|
+
license-files = ["LICENSE"]
|
|
8
|
+
authors = [{ name = "Sachin Kale" }]
|
|
9
|
+
requires-python = ">=3.10"
|
|
10
|
+
keywords = ["mcp", "model-context-protocol", "image-annotation", "coco", "yolo", "langgraph", "histopathology"]
|
|
11
|
+
classifiers = [
|
|
12
|
+
"Development Status :: 3 - Alpha",
|
|
13
|
+
"Intended Audience :: Science/Research",
|
|
14
|
+
"Programming Language :: Python :: 3",
|
|
15
|
+
"Topic :: Scientific/Engineering :: Image Recognition",
|
|
16
|
+
]
|
|
17
|
+
dependencies = [
|
|
18
|
+
# langchain-mcp-adapters does not support mcp 2.x yet
|
|
19
|
+
"mcp>=1.24,<2",
|
|
20
|
+
"httpx>=0.27",
|
|
21
|
+
"pillow>=10.0",
|
|
22
|
+
"pydantic>=2.0",
|
|
23
|
+
]
|
|
24
|
+
|
|
25
|
+
[project.optional-dependencies]
|
|
26
|
+
agent = [
|
|
27
|
+
"langgraph>=1.2",
|
|
28
|
+
"langchain>=1.4",
|
|
29
|
+
"langchain-mcp-adapters>=0.3",
|
|
30
|
+
"langchain-anthropic>=1.0",
|
|
31
|
+
]
|
|
32
|
+
|
|
33
|
+
[project.urls]
|
|
34
|
+
Homepage = "https://labels.sachin-kale.com/mcp"
|
|
35
|
+
Source = "https://github.com/sachinbkale27/label-image-mcp"
|
|
36
|
+
Issues = "https://github.com/sachinbkale27/label-image-mcp/issues"
|
|
37
|
+
|
|
38
|
+
[project.scripts]
|
|
39
|
+
label-image-mcp = "label_image_mcp.server:main"
|
|
40
|
+
label-image-agent = "label_image_mcp.agent:main"
|
|
41
|
+
|
|
42
|
+
[dependency-groups]
|
|
43
|
+
dev = [
|
|
44
|
+
"pytest>=8.0",
|
|
45
|
+
"pytest-asyncio>=0.23",
|
|
46
|
+
"respx>=0.21",
|
|
47
|
+
]
|
|
48
|
+
|
|
49
|
+
[build-system]
|
|
50
|
+
requires = ["hatchling"]
|
|
51
|
+
build-backend = "hatchling.build"
|
|
52
|
+
|
|
53
|
+
[tool.hatch.build.targets.wheel]
|
|
54
|
+
packages = ["src/label_image_mcp"]
|
|
55
|
+
|
|
56
|
+
[tool.pytest.ini_options]
|
|
57
|
+
asyncio_mode = "auto"
|
|
58
|
+
testpaths = ["tests"]
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
|
|
3
|
+
"name": "io.github.sachinbkale27/label-image-mcp",
|
|
4
|
+
"title": "Image Label",
|
|
5
|
+
"description": "Manage images and annotations in the Image Label app, and export COCO or YOLO datasets.",
|
|
6
|
+
"version": "0.1.0",
|
|
7
|
+
"websiteUrl": "https://labels.sachin-kale.com/mcp",
|
|
8
|
+
"repository": {
|
|
9
|
+
"url": "https://github.com/sachinbkale27/label-image-mcp",
|
|
10
|
+
"source": "github"
|
|
11
|
+
},
|
|
12
|
+
"packages": [
|
|
13
|
+
{
|
|
14
|
+
"registryType": "pypi",
|
|
15
|
+
"registryBaseUrl": "https://pypi.org",
|
|
16
|
+
"identifier": "label-image-mcp",
|
|
17
|
+
"version": "0.1.0",
|
|
18
|
+
"runtimeHint": "uvx",
|
|
19
|
+
"transport": {
|
|
20
|
+
"type": "stdio"
|
|
21
|
+
},
|
|
22
|
+
"environmentVariables": [
|
|
23
|
+
{
|
|
24
|
+
"name": "LABEL_USERNAME",
|
|
25
|
+
"description": "Image Label account username (needed to save annotations and upload)",
|
|
26
|
+
"isRequired": false
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"name": "LABEL_PASSWORD",
|
|
30
|
+
"description": "Image Label account password",
|
|
31
|
+
"isRequired": false,
|
|
32
|
+
"isSecret": true
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"name": "LABEL_API_URL",
|
|
36
|
+
"description": "API base URL",
|
|
37
|
+
"isRequired": false,
|
|
38
|
+
"default": "https://labels.sachin-kale.com/api"
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
]
|
|
43
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""MCP server and LangGraph agent for the Image Label web app."""
|