[package]
name = "kglite-mcp-server"
version = "0.11.13"
edition = "2021"
authors = ["Kristian dF Kollsgård <kkollsg@gmail.com>"]
license = "MIT"
description = "MCP server for kglite knowledge graphs — pure-Rust single-binary frontend for cypher_query / graph_overview / save_graph / read_code_source plus the generic source / GitHub surface from mcp-methods. No libpython link."
readme = "README.md"
repository = "https://github.com/kkollsga/kglite"
homepage = "https://github.com/kkollsga/kglite"
documentation = "https://kglite.readthedocs.io/en/latest/python/guides/mcp-servers.html"
keywords = ["mcp", "knowledge-graph", "cypher", "kglite", "graph"]
categories = ["database", "command-line-utilities"]

# The server body lives in the library (`run`) so two frontends share
# one build: this crate's thin binary (`cargo install`, libpython-free)
# and the `kglite` Python wheel's PyO3 wrapper (which calls `run` inside
# `py.detach`). No duplicated engine, no separate wheel.
[lib]
name = "kglite_mcp_server"
path = "src/lib.rs"

[[bin]]
name = "kglite-mcp-server"
path = "src/main.rs"

[dependencies]
# Generic MCP server framework (rmcp + manifest + source/github tools).
# Switched from git+rev to crates.io in 0.9.26+ — mcp-methods publishes
# there as of 0.3.30. Cargo.lock locks the exact version; bumps are
# explicit via `cargo update -p mcp-methods`. We still depend on the
# pure-Rust crate only (no pyo3 in tree, no libpython link).
# 0.3.42 required: serve_prompts injects skill `description` (## When to
# use) + honors `references_tools`, which the cross-tool skills below need.
mcp-methods = { version = "0.3.44", default-features = false, features = ["server"] }

# kglite (pure-Rust core) — no pyo3 in the resulting binary, no
# libpython link. The 0.10.1 lift moved KnowledgeGraph +
# source_location into kglite::api so mcp-server no longer needs
# to route through the kglite-py wheel crate (which would drag
# pyo3 along). Local dev uses the path dep; `cargo publish`
# strips path and falls back to the version requirement, keeping
# this in lockstep with the kglite core version.
# Verified: `cargo tree -p kglite-mcp-server | grep pyo3` → empty.
# `okf`: enables the code_tree docs pass (ingest a repo's markdown as :Doc
# nodes + link them to code) so the open-source workspace can build with
# include_docs=true.
kglite = { version = "0.11", path = "../kglite", default-features = false, features = ["okf"] }

# rmcp re-export for the dynamic tool registration path.
rmcp = { version = "1.6", features = ["server", "macros", "transport-io", "schemars"] }

# Async runtime + JSON
# `net` is needed by csv_http's TcpListener — was previously pulled
# in transitively by fastembed → reqwest → hyper → tokio/net. After
# making fastembed optional in 0.10.1, declare net explicitly so the
# default build still compiles.
tokio = { version = "1", features = ["macros", "rt-multi-thread", "io-std", "fs", "sync", "time", "net"] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
regex = "1"
schemars = "1"

# Error handling + CLI
anyhow = "1"
clap = { version = "4", features = ["derive"] }

# Logging
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }

# CSV-over-HTTP server (extensions.csv_http_server). hyper 1.x with
# its server adapter from hyper-util — both are already in the
# resolved dep graph (rmcp uses hyper transitively), so this just
# surfaces them as direct deps for the csv_http module.
hyper = { version = "1", features = ["server", "http1"] }
hyper-util = { version = "0.1", features = ["server", "tokio", "http1"] }
http-body-util = "0.1"
bytes = "1"

[features]
# `fastembed` is an OPTIONAL feature, default OFF. Enabling it
# pulls in `kglite/fastembed` → fastembed → ort-sys, which has
# a flaky upstream binary download (parcel.pyke.io CDN) that
# caused 0.10.1 CI breakage when the rust-cache invalidated and
# the fresh download silently produced broken link instructions.
# Users who want `text_score()` semantic search via the YAML
# manifest `extensions.embedder` block: `cargo install
# kglite-mcp-server --features fastembed`. Users who don't need
# it (the common case — most MCP servers are just cypher_query
# + graph_overview + read_code_source) get a smaller binary,
# faster build, and no ONNX runtime dep.
default = []
fastembed = ["kglite/fastembed"]
