Package Exports
- @stackguide/mcp-server
- @stackguide/mcp-server/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@stackguide/mcp-server) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
StackGuide MCP Server
A Model Context Protocol (MCP) server that provides dynamic language and framework context for AI coding assistants. Compatible with Cursor and GitHub Copilot.
Features
- 🎯 Dynamic Context Loading: Load context based on your project type (Python/Django, React/Node, etc.)
- 📋 Rules Management: Select and apply coding standards, best practices, and security guidelines
- 📚 Knowledge Base: Access architecture patterns, common issues solutions, and code snippets
- 💾 Configuration Persistence: Save and load your preferred configurations
- 🔄 Compatible: Works with both Cursor and GitHub Copilot
- ✨ Dynamic Rule Management: Create, edit, and delete rules at runtime using tools
- 🌐 Web Documentation: Fetch and cache documentation from any URL
- 📝 Rule Templates: Quick-start templates for common rule types (coding-standard, best-practice, security, architecture, testing)
- 🔗 Cursor Directory Integration: Browse, search, and import rules from cursor.directory - a community-driven repository of AI coding rules
Supported Project Types
| Type | Languages | Frameworks |
|---|---|---|
python-django |
Python | Django, DRF |
python-fastapi |
Python | FastAPI |
python-flask |
Python | Flask |
react-node |
JavaScript, TypeScript | React, Node.js, Express |
react-typescript |
TypeScript | React |
vue-node |
JavaScript, TypeScript | Vue.js, Node.js |
nextjs |
JavaScript, TypeScript | Next.js, React |
express |
JavaScript, TypeScript | Express.js |
nestjs |
TypeScript | NestJS |
laravel |
PHP | Laravel |
rails |
Ruby | Ruby on Rails |
golang |
Go | - |
rust |
Rust | - |
Installation
From npm (Recommended)
npm install -g @stackguide/mcp-serverFrom Source
git clone https://github.com/taimiralain/StackGuide-MCP.git
cd StackGuide-MCP
npm install
npm run buildConfiguration
For Cursor
Add to your Cursor settings (.cursor/mcp.json):
{
"mcpServers": {
"stackguide": {
"command": "npx",
"args": ["-y", "@stackguide/mcp-server"]
}
}
}Or if installed from source:
{
"mcpServers": {
"stackguide": {
"command": "node",
"args": ["/path/to/StackGuide-MCP/dist/index.js"]
}
}
}For VS Code with GitHub Copilot
Add to .vscode/mcp.json in your workspace:
{
"mcpServers": {
"stackguide": {
"command": "npx",
"args": ["-y", "@stackguide/mcp-server"]
}
}
}Or add to your user settings (settings.json):
{
"github.copilot.chat.mcpServers": {
"stackguide": {
"command": "npx",
"args": ["-y", "@stackguide/mcp-server"]
}
}
}Usage
Available Tools
Project Type Management
list_project_types- List all supported project typesselect_project_type- Activate a project type contextget_current_context- Get the currently active context
Rules Management
list_rules- List available rules for current projectget_rule- Get full content of a specific ruleselect_rules- Select which rules to include in contextsearch_rules- Search rules by keyword
Knowledge Base
list_knowledge- List knowledge base filesget_knowledge- Get content of a knowledge fileselect_knowledge- Select knowledge to includesearch_knowledge- Search knowledge base
Configuration
save_configuration- Save current context setupload_configuration- Load a saved configurationlist_configurations- List all saved configurationsdelete_configuration- Delete a configurationexport_configuration- Export config as JSONimport_configuration- Import config from JSON
Dynamic Rule Management (NEW!)
create_rule- Create a new custom rule from scratchcreate_rule_from_template- Create a rule using a templatelist_rule_templates- List available rule templatesupdate_rule- Update an existing user ruledelete_rule- Delete a user rulelist_user_rules- List all user-created rulesexport_user_rules- Export all user rules as JSONimport_user_rules- Import user rules from JSON
Web Documentation (NEW!)
fetch_web_docs- Fetch documentation from any URLfetch_multiple_docs- Fetch multiple URLs at onceget_web_doc- Get a cached web documentsearch_web_docs- Search cached documentationlist_web_docs- List all cached documentsget_suggested_docs- Get suggested docs for a project typeremove_web_doc- Remove a cached document
Cursor Directory Integration (NEW!)
browse_cursor_directory- Browse rules by category from cursor.directorysearch_cursor_directory- Search for rules on cursor.directoryget_cursor_directory_rule- Get a specific rule by sluglist_cursor_directory_categories- List all available categoriesget_popular_cursor_rules- Get popular/featured rulesimport_cursor_directory_rule- Import a rule into your local collection
Context
get_full_context- Get complete active contextadd_custom_rule- Add a custom rule
Example Workflow
Select your project type:
Use select_project_type with "react-node"View available rules:
Use list_rules to see all available rulesSelect specific rules:
Use select_rules with the IDs of rules you wantSave your configuration:
Use save_configuration with a name like "My React Setup"Get full context for AI:
Use get_full_context to get all selected rules and knowledge
Available Resources
rules://{project_type}/all- All rules for a project typeknowledge://{project_type}/all- All knowledge for a project typecontext://active- Currently active context (includes rules, user rules, knowledge, and web docs)user-rules://{project_type}/all- All user-created rules for a project typeweb-doc://{doc_id}- Specific cached web documenttemplates://rules- Available rule templates
Available Prompts
setup_project- Initialize context for a new projectcode_review- Review code with active rulesapply_patterns- Apply architecture patterns
Adding Custom Rules
Via Tool
Use the add_custom_rule tool with:
name: Rule namecategory: One ofcoding-standards,best-practices,security,performance,architecture,testing,documentation,naming-conventionscontent: Rule content in Markdowndescription: Brief description
Via Files
Add Markdown files to the data/rules/{project-type}/{category}/ directory:
# Rule Title
Description of the rule.
## Guidelines
- Guideline 1
- Guideline 2
## Examples
```python
# Code example
## Configuration Storage
User configurations are stored in `~/.stackguide/`:
- `configurations.json` - All saved configurations
- `rules/{project-type}/*.json` - User-created rules
- `web-docs/cache.json` - Cached web documentation
## Development
### Build
```bash
npm run buildRun in Development
npm run devProject Structure
StackGuide-MCP/
├── src/
│ ├── index.ts # Main entry point
│ ├── config/
│ │ ├── types.ts # TypeScript types
│ │ └── persistence.ts # Configuration storage
│ ├── resources/
│ │ ├── rulesProvider.ts # Rules management
│ │ └── knowledgeProvider.ts # Knowledge base
│ └── services/
│ ├── ruleManager.ts # Dynamic rule CRUD
│ └── webDocumentation.ts # Web docs fetcher
├── data/
│ ├── rules/ # Rule files by project type
│ │ ├── python-django/
│ │ └── react-node/
│ └── knowledge/ # Knowledge files by project type
│ ├── python-django/
│ └── react-node/
├── docs/
│ └── ADDING_CUSTOM_RULES.md # Guide for adding rules
├── package.json
├── tsconfig.json
└── README.mdDynamic Rule Management
Creating Rules from Templates
List available templates:
Use list_rule_templatesCreate a rule from template:
Use create_rule_from_template with: - templateId: "coding-standard" - projectType: "react-node" - name: "My Team Standards"Edit the rule:
Use update_rule with the rule ID and new content
Creating Rules from Scratch
Use create_rule with:
- projectType: "python-django"
- name: "API Versioning"
- category: "best-practices"
- content: "# API Versioning\n\nAlways version your APIs..."
- description: "Guidelines for API versioning"Web Documentation
Fetching Documentation
Use fetch_web_docs with:
- url: "https://react.dev/reference/react/useState"
- projectType: "react-node"
- title: "useState Hook"Getting Suggestions
Use get_suggested_docs with projectType: "react-node"This returns popular documentation URLs for the framework.
Cursor Directory Integration
cursor.directory is a community-driven repository of cursor rules for various technologies. StackGuide-MCP integrates with it to let you:
Browse Rules by Category
Use browse_cursor_directory with category: "typescript"Available categories include: typescript, python, react, next.js, vue, django, fastapi, nestjs, prisma, tailwindcss, and many more.
Search for Rules
Use search_cursor_directory with query: "react hooks best practices"Get Popular Rules
Use get_popular_cursor_rulesReturns featured rules from popular frameworks.
Import Rules
Use import_cursor_directory_rule with:
- slug: "nextjs-react-typescript-cursor-rules"
- projectType: "react-typescript"
- category: "best-practices"This fetches the rule from cursor.directory and saves it to your local rules collection.
Publishing to npm
Prerequisites
- Create an npm account at npmjs.com
- Login to npm:
npm login
Steps to Publish
Update version in
package.json:npm version patch # or minor, major
Build the project:
npm run buildTest locally (optional):
npm link stackguide-mcp # Test the command npm unlink
Publish to npm:
npm publish --access public
Note: The package is scoped (
@stackguide/mcp-server), so you need--access publicfor the first publish.Verify publication:
npm view @stackguide/mcp-server
Updating the Published Package
npm version patch # Bump version
npm run build
npm publishPublishing Checklist
- All tests pass
- README is up to date
- Version is bumped
- Build succeeds
-
mainandbinfields in package.json point to correct files - Keywords and description are accurate
Contributing
- Fork the repository
- Create a feature branch
- Add your rules/knowledge files or enhance the server
- Submit a pull request
Adding Support for New Frameworks
- Add project type to
src/config/types.ts - Create rule files in
data/rules/{new-type}/ - Create knowledge files in
data/knowledge/{new-type}/
License
GPL-3.0 - See LICENSE for details.