@kg-chat/mcp-server
v1.0.3
Published
MCP server for KG Chat - Connect your notes and tables to any MCP client
Downloads
382
Maintainers
Readme
KG Chat MCP Server
Connect your KG Chat notes and tables to Claude Desktop and other MCP-compatible clients.
What is MCP?
The Model Context Protocol (MCP) is an open standard that enables AI assistants like Claude to securely access your data and tools. This MCP server provides Claude with direct access to your KG Chat notes and tables.
Features
- Notes Management: Create, read, update, and delete notes
- Tables Management: Manage table schemas and data
- Secure Authentication: Uses API tokens with granular permissions
- Easy Setup: Simple command-line interface
Prerequisites
- Node.js 18 or higher
- A KG Chat account with API token (generate at
/settings/mcp) - Claude Desktop (for integration)
Installation
No installation required! Use directly with npx:
npx @kg-chat/mcp-server --token YOUR_TOKENGetting Your API Token
- Log in to your KG Chat account
- Navigate to Settings → MCP Integration
- Click "Create Token"
- Select the permissions you need
- Copy your token (it will only be shown once!)
Configuration
Environment Variables
APP_URL: the base URL for your KG Chat deployment. The MCP server CLI automatically reuses this value.KG_CHAT_API_TOKEN: API token for authentication (lets you omit--token).
Command-Line Options
Options:
-t, --token <token> API token for authentication (or set KG_CHAT_API_TOKEN)
-a, --app-url <url> KG Chat app URL (optional override, defaults to https://kgchat.app)
-u, --url <url> Legacy alias for `--app-url`
-V, --version output the version number
-h, --help display help for commandClaude Desktop Integration
macOS
Open the Claude Desktop config file:
~/Library/Application Support/Claude/claude_desktop_config.jsonAdd the following configuration:
{ "mcpServers": { "kg-chat": { "command": "npx", "args": [ "@kg-chat/mcp-server", "--token", "YOUR_TOKEN_HERE" ] } } }
The CLI automatically uses the APP_URL value that you configured for your KG Chat app, so you can keep the Claude Desktop config focused on the API token.
- Restart Claude Desktop
Windows
Open the Claude Desktop config file:
%APPDATA%\Claude\claude_desktop_config.jsonAdd the same configuration as macOS
Restart Claude Desktop
If you installed globally:
{
"mcpServers": {
"kg-chat": {
"command": "kg-chat-mcp",
"args": [
"--token",
"YOUR_TOKEN_HERE"
],
}
}
}Ensure your KG Chat app exports APP_URL (typically via .env.local) so the MCP server can connect without extra CLI flags.
Available Tools
Once connected, Claude will have access to the following tools:
Notes
list_notes- List all your notesget_note- Get a specific note by IDcreate_note- Create a new noteupdate_note- Update an existing notedelete_note- Delete a note
Tables
list_tables- List all tablesget_table- Get table schema and metadatacreate_table- Create a new tableupdate_table- Update table schemadelete_table- Delete a tablesearch_tables- Search tables by name
Table Rows
list_rows- List all rows in a tableget_row- Get a specific rowcreate_row- Insert a new rowcreate_rows_batch- Insert multiple rows at onceupdate_row- Update an existing rowdelete_row- Delete a row
Usage Examples
In Claude Desktop
Once configured, you can ask Claude:
- "Can you list all my notes?"
- "Create a note titled 'Meeting Notes' with content about today's meeting"
- "Show me all tables"
- "Add a new row to the 'Customers' table with name 'John' and email '[email protected]'"
- "Search for tables related to 'projects'"
Permissions
The server requires API tokens with appropriate permissions:
notes:read- Read notesnotes:write- Create and update notesnotes:delete- Delete notestables:read- Read table schemastables:write- Create and update tablestables:delete- Delete tablestable_rows:read- Read table datatable_rows:write- Insert and update rowstable_rows:delete- Delete rows
Troubleshooting
"Error: API token is required"
Make sure you're passing the --token flag with your API token, or set KG_CHAT_API_TOKEN in your environment (e.g., .env.local).
"Error: App URL not provided"
Set APP_URL in your .env/.env.local; the CLI automatically loads the value that your KG Chat app already uses.
"Error: Invalid token format"
API tokens should start with kg_live_. Make sure you copied the full token.
Authentication errors
Check that:
- Your token hasn't expired (check in Settings → MCP Integration)
- Your token has the required permissions
- Your KG Chat app exports the same
APP_URLvalue that the MCP server relies on
MCP server not showing up in Claude Desktop
- Make sure the config file is valid JSON
- Verify the path to the config file is correct
- Restart Claude Desktop after making changes
- Check the Claude Desktop logs for errors
Security Best Practices
- Never commit tokens to version control
- Use environment variables for tokens in automated setups
- Set expiration dates on tokens (30-90 days recommended)
- Use minimal permissions - only grant what you need
- Rotate tokens regularly
- Revoke unused tokens immediately
Development
Building from source
# Clone the repository
git clone https://github.com/your-org/kg-chat-1.git
cd kg-chat-1/packages/mcp-server
# Install dependencies
npm install
# Build
npm run build
# Run locally
node dist/index.js --token YOUR_TOKENTesting
To test the server without Claude Desktop:
# Run the server
npm run build
node dist/index.js --token YOUR_TOKEN
# The server communicates via stdin/stdout using the MCP protocol
# You can test with MCP debugging toolsLicense
MIT
Support
For issues and questions:
- Check the documentation
- Open an issue on GitHub
