-
Couldn't load subscription status.
- Fork 180
feat(mcp): Add section-based document handling to prevent token limit issues #18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add FastMarkdownMCP server for markdown file monitoring Create MCPServerStatus component with real-time status display Implement backend endpoints for MCP configuration and monitoring Add setup script for automated installation Integrate with Claude Desktop configuration Add continuous file monitoring and synchronization Implement server status checks and logging Add configuration copy functionality Style UI to match application theme Fast Markdown MCP Server Integration Features 🔄 Real-time markdown file monitoring and synchronization 📊 Server status dashboard with live updates 🔍 File content and metadata tracking 🚀 One-command setup script 🎨 Modern UI with dark theme 📝 Automatic log collection ⚡ Fast API backend integration 🔌 Claude Desktop MCP integration Technical Details Python-based MCP server with FastAPI backend React component for status display WebSocket-like updates using polling Cross-platform path handling Graceful error handling and recovery Comprehensive logging system Setup Clone the repository Run ./fast-markdown-mcp/setup.sh Start services with ./start.sh Documentation Full documentation available in: README.md - Server setup and configuration MCPServerStatus.tsx - UI component main.py - Backend implementation Testing Server status detection File monitoring Configuration management UI responsiveness Error handling Dependencies Python 3.10+ Node.js FastAPI React MCP SDK
The MCP server configuration endpoint was calculating paths incorrectly by traversing one level too high in the directory structure (parents[3]). This caused paths to miss the 'DevDocs' directory, resulting in ENOENT errors when trying to find the Python virtual environment and markdown storage. Changed Path(file).parents[3] to parents[2] to ensure paths are relative to the DevDocs root directory instead of the GitHub directory. Impact: Fixes ENOENT errors when starting MCP server Ensures consistent paths between API and MCP settings Maintains proper virtual environment and storage locations
… issues Files Changed: fast-markdown-mcp/src/fast_markdown_mcp/document_structure.py Added new Section dataclass to represent document sections Implemented DocumentStructure class for parsing and managing document sections Added methods for section ID generation and table of contents creation Added functionality to extract specific sections by ID fast-markdown-mcp/src/fast_markdown_mcp/server.py Added two new MCP tools: get_table_of_contents: Lists all sections in a document with their IDs get_section: Retrieves specific sections by ID to avoid loading entire documents Enhanced MarkdownStore class with section caching and management Added structure_cache to store parsed document structures Integrated DocumentStructure for section-based content retrieval New Features: Section-based document navigation Document structure caching for improved performance Table of contents generation Section-specific content retrieval URL-friendly section ID generation Benefits: Prevents token limit issues by allowing partial document loading Improves navigation of large documents Reduces memory usage by loading only requested sections Maintains document structure for better content organization
…vDocs into Experiment_Branch
This makes MCP server run in Experiment_branch
This comment was marked as off-topic.
This comment was marked as off-topic.
Shubham-Khichi
approved these changes
Jan 31, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Files Changed:
fast-markdown-mcp/src/fast_markdown_mcp/document_structure.py
Added new Section dataclass to represent document sections
Implemented DocumentStructure class for parsing and managing document sections
Added methods for section ID generation and table of contents creation
Added functionality to extract specific sections by ID
fast-markdown-mcp/src/fast_markdown_mcp/server.py
Added two new MCP tools:
get_table_of_contents: Lists all sections in a document with their IDs
get_section: Retrieves specific sections by ID to avoid loading entire documents
Enhanced MarkdownStore class with section caching and management
Added structure_cache to store parsed document structures
Integrated DocumentStructure for section-based content retrieval
New Features:
Section-based document navigation
Document structure caching for improved performance
Table of contents generation
Section-specific content retrieval
URL-friendly section ID generation
Benefits:
Prevents token limit issues by allowing partial document loading
Improves navigation of large documents
Reduces memory usage by loading only requested sections
Maintains document structure for better content organization