gliner2-mcp
MCP server that exposes GLiNER2 entity extraction, classification, and JSON extraction as tools.
Quickstart
- Install dependencies:
uv sync
- Run the MCP server:
uv run gliner2-mcp
Environment configuration
This server is configured via environment variables (optionally loaded from .env).
| Variable | Default | Description |
|---|---|---|
GLINER2_MODEL_ID |
fastino/gliner2-base-v1 |
GLiNER2 model id or path. |
GLINER2_DEVICE |
empty | Device override passed to from_pretrained when supported. |
GLINER2_MAX_TEXT_LENGTH |
0 |
Maximum input length. 0 disables the limit. |
GLINER2_MCP_LOG_LEVEL |
INFO |
Log level for server logging. |
GLINER2_MCP_ENV_FILE |
empty | Path to an env file to load before reading the variables above. |
If GLINER2_MCP_ENV_FILE is not set, the server will load .env from the working directory when it exists.
MCP tools
extractEntities(text, labels)returns a mapping of label to entity spans.classifyText(text, schema)returns a mapping of field name to chosen label or list of labels.extractJson(text, schema)returns a JSON object that matches the provided schema.
Available Models
GLiNER2 family models on Hugging Face
Development
uv sync --dev
uv run ruff check .
Testing
Run the default test suite (unit + contract tests):
uv sync --extra dev
uv run --extra dev pytest -q
Run real-model integration tests (downloads/loads actual GLiNER2 weights):
GLINER2_MCP_RUN_INTEGRATION=1 uv run --extra dev pytest -q -m integration
Recommended pre-release check:
uv run --extra dev pytest -q
GLINER2_MCP_RUN_INTEGRATION=1 uv run --extra dev pytest -q -m integration
License
MIT. See LICENSE.
Metadata
Release files for gliner2-mcp 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| gliner2_mcp-0.1.0.tar.gz | 98.3 kB | Without provenance | Details for gliner2_mcp-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| gliner2_mcp-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for gliner2_mcp-0.1.0-py3-none-any.whl |
Total release size: 105.8 kB
Release files / gliner2_mcp-0.1.0.tar.gz
| Download URL | gliner2_mcp-0.1.0.tar.gz |
|---|---|
| Size | 98.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f78254b286b5866ca34920d9a7f6a033a05f238b64b4e404516208c056336655
|
|
BLAKE2b-256 checksum How to use checksums |
e41126b9e9497cba7ad3539f742c2597d275402bbdd09fd7d469bdcd21d58edd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.16 {"installer":{"name":"uv","version":"0.9.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / gliner2_mcp-0.1.0-py3-none-any.whl
| Download URL | gliner2_mcp-0.1.0-py3-none-any.whl |
|---|---|
| Size | 7.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e174052f3ff8081f2a711ce8e7eec2a79a3b36c80f16c95e6c72edaf5b02f662
|
|
BLAKE2b-256 checksum How to use checksums |
0a655dd960a84c56ba4b2aa737c0bb58ee5ae9a860b1aae74a7962853ee93471
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.16 {"installer":{"name":"uv","version":"0.9.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for gliner2-mcp 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.