Conversation
WalkthroughAdded a new MCP Server section to README and introduced a new docs/mcp-server.md detailing setup and usage of the TRUF.NETWORK Postgres MCP server with AI clients (Claude Desktop), including prerequisites, installation, tools, troubleshooting, and uninstall steps. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User as User (Claude Desktop)
participant Claude as AI Client
participant MCP as TRUF.NETWORK Postgres MCP Server
participant DB as Kwil/Postgres
User->>Claude: Ask to query TRUF.NETWORK data
Claude->>MCP: Invoke MCP tools (list_schemas, execute_sql, ...)
MCP->>DB: Connect and run SQL
DB-->>MCP: Results / errors
MCP-->>Claude: Structured response
Claude-->>User: Present findings
rect rgb(235, 245, 255)
note over Claude,MCP: Configuration via install.sh and Claude config
end
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Assessment against linked issues
Poem
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. ✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
Time Submission Status
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (13)
docs/mcp-server.md (12)
5-8: Polish heading and fix grammar; clarify multi-client stance.Rename the section and rephrase the note to read more naturally.
-## Current Supported AI Client -1. Claude Desktop - -Please inquiry for another client support. +## Supported AI clients +1. Claude Desktop + +For other clients, please inquire or open an issue.
12-16: Tighten prerequisite phrasing and consistency.Add articles, use parallel structure, and clarify intent.
-1. **Local Kwil Node** - Running TRUF.NETWORK node -2. **Python 3.12+** - Required for MCP server -3. **pipx** - For isolated installation -4. **Claude Desktop** - For AI integration +1. **Local Kwil node** — a running TRUF.NETWORK node +2. **Python 3.12+** — required to run the MCP server +3. **pipx** — for isolated installation +4. **Claude Desktop** — for AI integration
19-27: macOS: mention restarting the shell after ensurepath.pipx modifies PATH; users often miss the need to restart/reload the shell.
pipx ensurepath +## Open a new terminal (or `exec $SHELL -l`) so PATH changes take effect
29-37: Linux: provide a fallback for Python 3.12 and venv; verify availability.On many Ubuntu/Debian releases,
apt install python3.12may not exist without extra repos. Suggest addingpython3.12-venvand a fallback note.-# Install Python 3.12+ -sudo apt update && sudo apt install python3.12 +# Install Python 3.12+ (ensure your distro provides this package) +sudo apt update && sudo apt install -y python3.12 python3.12-venv || echo "If not available, consider using the Deadsnakes PPA or pyenv." # Install pipx -python3 -m pip install --user pipx -python3 -m pipx ensurepath +python3 -m pip install --user pipx +python3 -m pipx ensurepath +## Open a new terminal so PATH changes take effectTo confirm the best instruction for your target distros, please verify whether Ubuntu 22.04/24.04 provide
python3.12in the default repos and whether recommending Deadsnakes is acceptable for your docs.
39-48: Windows: align pipx invocation with Windows conventions and add PATH note.Use the
pylauncher and mention restarting the shell. Optionally suggest Chocolatey install for pipx.-# Install pipx -python -m pip install --user pipx -python -m pipx ensurepath +# Install pipx +py -m pip install --user pipx +py -m pipx ensurepath +:: Close and reopen your terminal so PATH changes take effect +:: (Alternatively: `choco install pipx`)
50-52: Fix markdownlint MD034 (bare URL).Replace the bare URL with a markdown link.
-Download from https://claude.ai/download +Download from [claude.ai/download](https://claude.ai/download)
55-61: Call out OS support for install.sh; specify Windows approach.
install.shimplies Unix-like environments. Clarify Windows instructions (e.g., Git Bash/WSL) or provide a PowerShell alternative if available.-./install.sh +./install.sh +# On Windows: +# - Use Git Bash or WSL to run install.sh, or +# - If a PowerShell script is provided, run: `powershell -ExecutionPolicy Bypass -File .\install.ps1`If there is a Windows-native installer/script in the
postgres-mcprepo, reference it explicitly; otherwise, note Git Bash/WSL as the recommended path.
62-64: Improve configuration sentence for clarity.- - Database connection details (default: localhost:5432/kwild), just use the default if you didn't custom anything. + - Database connection details (default: host=localhost, port=5432, database=kwild). + If you haven't customized your setup, accept the defaults.
69-77: Add a security note: run with a read-only DB role when possible.Executing SQL from an AI client can be risky. Recommend least-privilege credentials and provide a quick-start snippet.
- `execute_sql` - Run basic SQL queries, including getting records, checking stream type, taxonomies, etc. - `get_index` - Get stream index data - `get_index_change` - Calculate percentage changes + +### Security best practices +- Use a dedicated, least-privilege Postgres role for MCP (prefer read-only wherever possible). +- Avoid connecting with superuser credentials. + +Example (Postgres): +```sql +-- Create a read-only role and grant minimal privileges +CREATE ROLE mcp_reader LOGIN PASSWORD '<strong-unique-password>'; +GRANT CONNECT ON DATABASE kwild TO mcp_reader; +GRANT USAGE ON SCHEMA public TO mcp_reader; +GRANT SELECT ON ALL TABLES IN SCHEMA public TO mcp_reader; +ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO mcp_reader; +```
80-84: Clarify networking language and add a common Postgres gotcha.“from local” is awkward; also mention
pg_hba.confand service status.-**Connection issues:** -- Verify your Kwil node is running -- Check database credentials -- Ensure PostgreSQL port 5432 is accessible from local +**Connection issues:** +- Verify your Kwil node is running. +- Check database credentials (host, port, db, user, password). +- Ensure PostgreSQL port 5432 is accessible from localhost/your machine. +- On Postgres, confirm `pg_hba.conf` allows local connections for the MCP user and restart Postgres after changes.
85-88: Add OS-specific config locations for Claude Desktop.The current path is macOS-only. Include Windows and Linux paths if applicable.
-**Claude integration:** -- Restart Claude Desktop after installation -- Check config file: `~/Library/Application Support/Claude/claude_desktop_config.json` +**Claude integration:** +- Restart Claude Desktop after installation. +- Check the config file: + - macOS: `~/Library/Application Support/Claude/claude_desktop_config.json` + - Windows: `%APPDATA%\Claude\claude_desktop_config.json` + - Linux: `~/.config/Claude/claude_desktop_config.json` (if applicable)Please verify the exact Windows/Linux paths for the current Claude Desktop builds and update accordingly.
91-93: Uninstall: mention config cleanup and client restart.Users may expect complete removal.
```bash pipx uninstall postgres-mcp+Optionally remove the MCP configuration file and restart Claude Desktop to clear cached settings.
</blockquote></details> <details> <summary>README.md (1)</summary><blockquote> `53-56`: **Optional: add to TOC and mirror style.** If you maintain a Table of Contents, consider adding “MCP Server” there. Also consider sentence-case for “AI clients” to match surrounding style. </blockquote></details> </blockquote></details> <details> <summary>📜 Review details</summary> **Configuration used**: CodeRabbit UI **Review profile**: CHILL **Plan**: Pro **💡 Knowledge Base configuration:** - MCP integration is disabled by default for public repositories - Jira integration is disabled by default for public repositories - Linear integration is disabled by default for public repositories You can enable these sources in your CodeRabbit configuration. <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between 993e96900e00b61bcf653828964d4c8c16d8b43b and 69c1a0dbcbb8cc9a9777c470b0c4435dd862e473. </details> <details> <summary>📒 Files selected for processing (2)</summary> * `README.md` (1 hunks) * `docs/mcp-server.md` (1 hunks) </details> <details> <summary>🧰 Additional context used</summary> <details> <summary>🪛 LanguageTool</summary> <details> <summary>docs/mcp-server.md</summary> [grammar] ~12-~12: There might be a mistake here. Context: ... Kwil Node** - Running TRUF.NETWORK node 2. **Python 3.12+** - Required for MCP server... (QB_NEW_EN) --- [grammar] ~13-~13: There might be a mistake here. Context: ...Python 3.12+** - Required for MCP server 3. **pipx** - For isolated installation 4. **... (QB_NEW_EN) --- [grammar] ~14-~14: There might be a mistake here. Context: ... 3. **pipx** - For isolated installation 4. **Claude Desktop** - For AI integration #... (QB_NEW_EN) --- [grammar] ~50-~50: There might be a mistake here. Context: ...pipx ensurepath ``` **Claude Desktop:** Download from https://claude.ai/download... (QB_NEW_EN) --- [grammar] ~80-~80: There might be a mistake here. Context: ...## Troubleshooting **Connection issues:** - Verify your Kwil node is running - Check... (QB_NEW_EN) --- [grammar] ~85-~85: There might be a mistake here. Context: ...ssible from local **Claude integration:** - Restart Claude Desktop after installatio... (QB_NEW_EN) </details> </details> <details> <summary>🪛 markdownlint-cli2 (0.17.2)</summary> <details> <summary>docs/mcp-server.md</summary> 51-51: Bare URL used (MD034, no-bare-urls) </details> </details> </details> <details> <summary>⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)</summary> * GitHub Check: acceptance-test </details> <details> <summary>🔇 Additional comments (1)</summary><blockquote> <details> <summary>README.md (1)</summary><blockquote> `53-56`: **LGTM: succinct README entry with correct relative link.** The new section is well placed between SDK features and the Development Guide. Link resolves to `./docs/mcp-server.md`. </blockquote></details> </blockquote></details> </details> <!-- This is an auto-generated comment by CodeRabbit for review status -->
resolves: https://github.com/trufnetwork/truf-network/issues/1121
Summary by CodeRabbit