Local Knowledge MCP
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Local Knowledge MCPshow me the contents of my project readme"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Local Knowledge MCP
A security-first, read-only Model Context Protocol (MCP) server for local folders.
Local Knowledge MCP lets an MCP client browse an explicit root allowlist, inspect metadata, read bounded text, and receive PDF/XLSX files as embedded resources. It is intentionally not a general-purpose filesystem write server.
Features
Read-only by design and default-deny.
Client paths use
root_alias + relative path; clients never send local absolute paths.Blocks unknown roots, parent traversal, symlink escape, hidden paths, and common secret-bearing files.
Atomically updates the persistent root configuration.
Reloads the security policy on every tool call, so
lk-add,lk-remove, andlk-cleartake effect without a project-specific runtime manager.Ships as a normal Python package with portable console commands.
Provides guided ChatGPT setup through OpenAI Secure MCP Tunnel without bundling shared tunnel identities or credentials.
Related MCP server: Document Search MCP Server
Requirements
Python 3.11 or newer.
uvis recommended;pipxalso works.For local stdio usage: an MCP client that can launch a local process.
For ChatGPT usage: OpenAI tunnel permissions and ChatGPT developer-mode access.
lk-chatgpt-setupguides this optional flow.
Install
Directly from GitHub
With uv:
uv tool install "git+https://github.com/TuanLe-bk18/local-knowledge-mcp.git"Or with pipx:
pipx install "git+https://github.com/TuanLe-bk18/local-knowledge-mcp.git"From a clone
git clone https://github.com/TuanLe-bk18/local-knowledge-mcp.git
cd local-knowledge-mcp
uv tool install .The installation provides:
local-knowledge-mcp
lk-init
lk-set
lk-add
lk-list
lk-remove
lk-clear
lk-chatgpt-setupQuick start
Initialize a secure empty configuration:
lk-initAdd one or more allowed folders:
lk-add project "~/Code/my-project"
lk-add notes "~/Documents/notes"
lk-listConnect a local stdio MCP client
lk-init prints an MCP client configuration using the installed executable. A typical configuration is:
{
"mcpServers": {
"local-knowledge": {
"command": "local-knowledge-mcp"
}
}
}Some desktop applications do not inherit your shell PATH. In that case, use the absolute command path printed by lk-init.
Restart or reconnect the MCP client after first adding the server. Root allowlist changes made while the server is running are loaded automatically on the next tool call.
See docs/client-setup.md for local stdio setup details and troubleshooting.
Connect ChatGPT with Secure MCP Tunnel
After configuring at least one root, run:
lk-chatgpt-setupThe command:
discovers
tunnel-client, or offers to download the latest officialopenai/tunnel-clientrelease;verifies the downloaded archive against the official
SHA256SUMS.txtasset;opens OpenAI Platform tunnel and runtime-key setup pages;
asks for the user's own
tunnel_idand hidden runtime API key;stores the runtime key outside the repository in a user-private
0600file;starts a managed tunnel runtime and waits until it reports
ready;opens ChatGPT connector settings and prints the tunnel ID to select or paste.
The runtime key must have Tunnels Read + Use. An admin key is not accepted, stored, or passed to the long-lived runtime. Tunnel creation remains in the authenticated OpenAI Platform UI, so every installation uses the user's own tunnel identity and permissions.
See docs/chatgpt-setup.md for prerequisites, non-interactive options, credential storage, and troubleshooting.
Root commands
Replace every configured root with one workspace root:
lk-set "/path/to/folder"Add or update an alias while preserving other roots:
lk-add project "/path/to/project"List roots without touching the MCP process:
lk-listRemove one alias:
lk-remove projectRemove all roots while keeping read-only/default-deny policy enabled:
lk-clearFolder inputs are expanded, required to exist, required to be directories, and saved as canonical absolute paths. Aliases must begin with a lowercase letter and may contain lowercase letters, numbers, hyphens, and underscores.
The persistent configuration is stored outside the repository at:
~/.config/local-knowledge-mcp/security.yamlNo personal root configuration is bundled in the package.
MCP tools
browse(root_alias, path="")
get_info(root_alias, path)
read_text(root_alias, path, max_chars=None)
read_document_resource(root_alias, path)Example tool arguments:
{
"root_alias": "project",
"path": "docs/architecture.md"
}read_document_resource returns allowed PDF/XLSX files as MCP EmbeddedResource values. It does not parse, OCR, index, or modify documents.
Security model
Every filesystem access reaches SecurityPolicy.resolve() before touching a client-selected path. The default generated policy enforces:
mode:
read_only: true
default_deny: true
path_policy:
allow_absolute_paths_from_client: false
allow_parent_traversal: false
allow_symlinks: false
allow_hidden_files: falseAdditional deny patterns block common credential, token, key, environment, build, and VCS paths. Direct text reads are UTF-8 only, extension-limited, binary-checked, file-size limited, and character-limited.
An empty root mapping is valid and denies every root alias. See SECURITY.md before changing policy defaults.
Scope
Included:
directory browsing;
file/directory metadata;
bounded text/source reading;
PDF/XLSX embedded resources;
local root allowlist management.
Not included:
write, edit, delete, move, or create operations;
arbitrary absolute-path access;
OCR or document parsing;
embeddings, vector databases, or RAG;
a shared hosted tunnel, shared runtime credential, or shared cloud runtime.
For ChatGPT, lk-chatgpt-setup configures the official outbound Secure MCP Tunnel client on the user's machine. This repository never bundles tunnel credentials, identifiers, API keys, or machine-specific runtime state.
Development
git clone https://github.com/TuanLe-bk18/local-knowledge-mcp.git
cd local-knowledge-mcp
uv sync --all-groups
uv run pytest -q
uv buildSee CONTRIBUTING.md for contribution guidelines.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseBqualityDmaintenanceA secure, read-only MCP server for browsing and searching files in a specified directory with path traversal protection and .gitignore support.3MIT
- Flicense-qualityBmaintenanceA local MCP server providing read-only access to documents like Word, PDF, Excel, and images, with file listing, reading, and metadata extraction.
- FlicenseAqualityCmaintenanceA read-only MCP server that enables AI assistants to search files, list directories, retrieve system info, and get file metadata on the local file system.4
- Flicense-qualityCmaintenanceRead-only MCP server for AI clients to browse and search project files securely, with configurable permissions, virtual paths, and key-based access.
Related MCP Connectors
Agent-native MCP server over the public saagarpatel.dev corpus. Read-only, stateless.
Read-only MCP server for ClassQuill, a tutoring-business-management platform.
MCP server for AgentDocs (agentdocs.eu): read, search, write, comment on & share Markdown docs.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/TuanLe-bk18/local-knowledge-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server