Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
📝 Summary
This PR integrates the Model Context Protocol (MCP) client into Srcbook. This integration significantly expands Srcbook's current and future capabilities by giving the local-first version access to a wide array of external tools and resources. Those included in the srcbook_mcp_config.example.json file require no API key or registration, meaning the community can begin building integrations with them immediately. This PR provides support for a single MCP server, sequential-thinking, implemented here with a simple on-off toggle in the dialog window during build sessions.
Importantly, MCP works only on the local dev server in this PR. Enabling MCP for local-first production will require addressing #456, and more generally, configuring Srcbook to target different builds based on the host machine's chip architecture (i.e. Intel vs Apple Silicon). I chose to keep this PR focused on the MCP integration and will address the above issue in a follow-up PR, and in the issue discussion on GitHub.
🛠 Implementation Details
MCP Client Integration:
packages/api/mcp/
.Enhanced AI Capabilities:
Configuration Updates:
README.md
to include MCP integration details.MCP_README.md
with comprehensive setup and usage instructions.Dependencies:
20.x
to ensure compatibility and stability, especially with regard to Rollup: this will become important later when implementing conditional build targeting in Docker based on whether the user's host machine runs on an Intel or ARM architecture."@modelcontextprotocol/sdk": "^1.1.0"
.📚 Related Documentation
Updated
README.md
:Added
MCP_README.md
:🔗 Related Issues
🧪 Testing
Unit Tests: (To be added)
Manual Testing:
Demo Video:
📸 Screenshots/GIFs
(If applicable, insert images or GIFs here)
🔗 Additional Information
Dependencies:
"@modelcontextprotocol/sdk": "^1.1.0"
20.x
to avoid compatibility issues, especially with Rollup handling different architectures.Setup Instructions:
packages/api/
.srcbook_mcp_config.example.json
tosrcbook_mcp_config.json
.srcbook_mcp_config.json
:/PATH/TO/YOUR/DESKTOP
and/PATH/TO/YOUR/DOWNLOADS
with the actual paths on your machine.🗣️ Future Development
Local Production Support in Docker:
Notebook Integration:
Additional Server Integrations:
📽️ Demo Video
A demonstration video showcasing the MCP integration (here, with the sequential-thinking server) is available on YouTube. Link
📚 Additional Resources
Notes for Reviewers:
Code Location: Most of the new code resides in the
packages/api/mcp/
directory. Please focus your review on this folder to understand the MCP client implementation.Configuration Requirements: Users must update their
srcbook_mcp_config.json
with the correct filesystem paths to enable MCP filesystem access. Detailed instructions are provided inMCP_README.md
.Pending Unit Tests: While unit tests are not yet included, they are being developed to ensure the reliability and stability of the MCP integration. Contributions or suggestions for testing strategies are welcome.
Contributors:
🎉 Conclusion
The MCP client is a significant expansion of Srcbook's potential, but more remains to be done to make it a fully functional feature, and addressing the issues around platform targeting and filesystem access is the next step in that process.
Thank you for reviewing this PR! 🙏