DevContext: Autonomous Context Awareness Model-Context-Protocol (MCP) Server 标志

DevContext: Autonomous Context Awareness Model-Context-Protocol (MCP) Server

社区
aiurda

DevContext is a cutting-edge Model Context Protocol (MCP) server designed to provide developers with continuous, project-centric context awareness. Unlike traditional context systems, DevContext continuously learns from and adapts to your development patterns and delivers highly relevant context providing a deeper understanding of your codebase.

发布者aiurda
代码仓库devcontext
语言HTML
复刻数
14
星标数
47
可用工具
5
传输类型stdio
分类
许可协议MIT
链接
  • 将工具接入 AI 工作流

    DevContext: Autonomous Context Awareness Model-Context-Protocol (MCP) Server 提供 MCP 功能,可供兼容的 AI 客户端和智能体使用。

  • 5 个可用工具

    浏览下方可调用的操作;如果服务器提供了名称和描述,也会一并显示。

  • 可直接复制的配置

    使用安装配置片段,在您首选的 MCP 客户端中配置此服务器。

  • 开源社区热度

    关联的代码仓库有 47 个 Star 和 14 个 Fork。

DevContext: Autonomous Context Awareness Model-Context-Protocol (MCP) Server

Empower your development workflow with intelligent context awareness - DevContext understands your codebase, conversations, and development patterns to provide relevant context exactly when you need it.

Introduction

DevContext is a cutting-edge Model Context Protocol (MCP) server designed to provide developers with continuous, project-centric context awareness. Unlike traditional context systems, DevContext continuously learns from and adapts to your development patterns. DevContext leverages sophisticated retrieval methods, focusing on keyword analysis, relationship graphs, and structured metadata to deliver highly relevant context during development, understanding both your conversations and your codebase at a deeper level.

The server operates with a database instance dedicated to a single project, eliminating cross-project complexity and ensuring performance with minimal resource requirements. DevContext builds a comprehensive understanding of your codebase - from repository structure down to individual functions - while continuously learning from and adapting to your development patterns.

The BEST way to use this MCP server is to follow the guide below on implementing the provided Cursor Rules system which in turn gives you:

  • Completely autonomous context management
  • Autonomous external documentation context and use
  • Complete task management workflow integration

Core Technologies

  • Node.js: Runtime environment (Node.js 18+)
  • TursoDB: SQL database optimized for edge deployment (compatible with SQLite)
  • Model Context Protocol SDK: For standardized communication with IDE clients
  • Cursor Rules: Autonomous development environment and workflow management
  • JavaScript/TypeScript: Pure JavaScript implementation with no external ML dependencies

Installation Guide

Prerequisites

  • Node.js 18.0.0 or higher
  • Cursor IDE with MCP support
  • TursoDB account (for database)

Step 1: Set up TursoDB Database

  1. Sign up for TursoDB:

    • Visit Turso and create an account
    • The free tier is sufficient for most projects
  2. Install Turso CLI (optional but recommended):

    bash
    curl -sSfL https://get.turso.tech/install.sh | bash
  3. Authenticate with Turso:

    bash
    turso auth login
  4. Create a project database:

    bash
    turso db create devcontext
  5. Get database credentials:

    bash
    # Get database URL
    turso db show devcontext --url
    
    # Create auth token
    turso db tokens create devcontext

    Save both the URL and token for the next step.

Step 2: Configure MCP in Cursor (can be applied to other IDE's as well)

Create or edit .cursor/mcp.json in your project directory:

json
{
  "mcpServers": {
    "devcontext": {
      "command": "npx",
      "args": ["-y", "devcontext@latest"],
      "enabled": true,
      "env": {
        "TURSO_DATABASE_URL": "your-turso-database-url",
        "TURSO_AUTH_TOKEN": "your-turso-auth-token"
      }
    }
  }
}

Replace your-turso-database-url and your-turso-auth-token with the values obtained in Step 1.

Cursor Rules Implementation

DevContext implements a sophisticated set of Cursor Rules that create an autonomous development environment. These rules guide Cursor's AI assistants in maintaining project scope alignment, incorporating up-to-date documentation, and implementing advanced task workflows.

Be on the lookout for the DevContext Project Generator which is coming very soon and will create a COMPLETE set up for your project to literally 10x your development workflow.

Key Rule Components

1. DevContext MCP Tools Usage Guide

The core rule defines a precise sequence for tool execution:

1. FIRST: Call initialize_conversation_context EXACTLY ONCE at START
2. AS NEEDED: Call update_conversation_context for code changes/new messages
3. AS NEEDED: Call retrieve_relevant_context when specific context is required
4. OCCASIONALLY: Call record_milestone_context for significant achievements
5. LAST: Call finalize_conversation_context EXACTLY ONCE at END

This workflow ensures comprehensive context management throughout the entire development session.

2. External Library Documentation Requirements

All external library usage must be preceded by proper documentation retrieval:

  • Two-Step Documentation Retrieval using Context7
  • Web Search Fallback for documentation not available through Context7
  • Multi-Source Documentation Synthesis for comprehensive understanding

This prevents common issues with incorrect API usage, incompatible versions, or missing dependencies.

3. Task Workflow System

The task workflow system enables:

  • Structured task management in tasks.md
  • Task ID-based implementation order
  • Status tracking with completion metadata
  • Project blueprint integration for architectural context

Setting Up Cursor Rules

  1. Create Rules Directory:

    bash
    mkdir -p .cursor/rules
  2. Download/Copy and Paste Rules:

Download or copy and paste the .cursor/rules directory into your project. Next, copy and paste the contents of the .cursorrules file in your project root and paste it into your cursor settings rules (Cursor Settings -> Rules -> User Rules). You should also copy and paste the .cursorrules file into your main directory as well.

  1. Customize Task Workflow (Optional): Once the cursor rules are implemented, restart Cursor and proceed to ask it to create tasks for you based on whatever project idea you may have.

Configuration Example

Below is a complete example of an mcp.json file that configures both DevContext and Context7 MCP servers:

json
{
  "mcpServers": {
    "devcontext": {
      "command": "npx",
      "args": ["-y", "devcontext@latest"],
      "enabled": true,
      "env": {
        "TURSO_DATABASE_URL": "libsql://your-project-db-name.turso.io",
        "TURSO_AUTH_TOKEN": "your_turso_auth_token_here"
      }
    },
    "context7": {
      "command": "npx",
      "args": ["-y", "@upstash/context7-mcp@latest"]
    }
  }
}

Important Parameters

ParameterDescriptionDefault Value
TURSO_DATABASE_URLURL of your TursoDB instanceNone (Required)
TURSO_AUTH_TOKENAuthentication token for TursoDBNone (Required)

Table of Contents

System Overview

DevContext is a state-of-the-art context management system for software development, implementing the Model Context Protocol (MCP) with advanced context retrieval techniques.

The system operates as a Node.js application with a modular JavaScript codebase, bundled into a single .js file using esbuild. It leverages TursoDB (or similar SQL database) as the persistent store for all context, metadata, and optional logs for a specific project.

Key Differentiators:

  • Non-Vector Retrieval: Context retrieval uses sophisticated keyword analysis, relationship graphs, and structured metadata instead of vector embeddings
  • Project-Centric Design: Each server instance is dedicated to a single project, simplifying data management
  • Minimal Dependencies: Restricted to core essentials - MCP SDK, TursoDB client, and lightweight AST parsing
  • Hierarchical Understanding: Context is understood from repository structure down to function/variable levels
  • Intelligent Context Prioritization: Multi-factor relevance scoring based on recency, importance, relationships, and developer focus

Core Components

Text Processing

  • Language-aware tokenization with specialized handling for JavaScript/TypeScript, Python, Java, C#, Ruby, and Go
  • Keyword extraction with language-specific weighting
  • Semantic boundary respecting n-grams
  • Language-specific idiom detection

Context Management

  • Code entity indexing and relationship tracking
  • Conversation topic segmentation and purpose detection
  • Timeline event recording and milestone snapshots
  • Focus area prediction based on developer activity

Pattern Recognition

  • Code pattern identification and storage
  • Automatic pattern learning from examples
  • Cross-session pattern promotion
  • Design pattern detection

Intent & Relevance Analysis

  • Query intent prediction
  • Multi-factor context prioritization
  • Token budget management
  • Context integration across topic shifts

MCP Tools

DevContext implements the following MCP tools that can be invoked by Cursor IDE:

initialize_conversation_context

Initializes a new conversation session with comprehensive project context.

When to use: At the beginning of every conversation, exactly once.

Key parameters:

  • initialQuery: The user's first message or question
  • contextDepth: Minimal, standard, or comprehensive context depth
  • includeArchitecture: Whether to include architectural context
  • focusHint: Optional focus on specific code entity

Returns: Conversation ID and initial context summary

update_conversation_context

Updates the active context with new messages and code changes.

When to use: After code changes or new messages are exchanged.

Key parameters:

  • conversationId: ID from initialize_conversation_context
  • newMessages: New messages exchanged since last update
  • codeChanges: Code files created or modified
  • preserveContextOnTopicShift: Whether to maintain context during topic changes

Returns: Updated focus and context continuity information

retrieve_relevant_context

Retrieves context snippets relevant to a specific query.

When to use: When specific project context is needed.

Key parameters:

  • conversationId: ID from initialize_conversation_context
  • query: Specific question about the project
  • constraints: Optional filters for entity types, file paths, etc.
  • weightingStrategy: How to prioritize results

Returns: Relevant context snippets with explanations

record_milestone_context

Records significant development milestones for future reference.

When to use: After completing important features, fixing critical bugs, or making architectural decisions.

Key parameters:

  • conversationId: ID from initialize_conversation_context
  • name: Short, descriptive milestone name
  • description: Detailed explanation
  • milestoneCategory: Category (feature, bug fix, refactoring, etc.)
  • assessImpact: Whether to analyze impact

Returns: Milestone ID and impact assessment

finalize_conversation_context

Concludes a conversation, extracting learnings and suggesting next steps.

When to use: At the end of every conversation, exactly once.

Key parameters:

  • conversationId: ID from initialize_conversation_context
  • extractLearnings: Whether to identify and extract learnings
  • promotePatterns: Whether to promote patterns to global repository
  • generateNextSteps: Whether to suggest follow-up actions

Returns: Conversation summary, extracted learnings, and next steps

Data Architecture

DevContext uses a SQL database (TursoDB) with the following core tables:

  • code_entities: Stores indexed code from files, functions, classes, etc.
  • entity_keywords: Maps keywords to code entities for search
  • code_relationships: Tracks relationships between code entities
  • conversation_history: Stores conversation messages
  • conversation_topics: Segments conversations into coherent topics
  • timeline_events: Records significant development events
  • project_patterns: Stores identified code patterns
  • focus_areas: Tracks developer attention and intention

The database schema is automatically created and maintained by the server.

Technical Specifications

  • Node.js: Version 18.0.0 or higher required
  • Database: TursoDB (or compatible SQLite)
  • Bundling: ESBuild for single-file deployment
  • Protocol: Model Context Protocol via @modelcontextprotocol/sdk
  • Parsing: Lightweight JavaScript AST parsing (acorn)
  • Operating Systems: Cross-platform (Windows, macOS, Linux)

Performance Considerations

DevContext is optimized for performance with:

  • Efficient SQL queries with proper indexing
  • In-memory caching for frequently accessed data
  • Incremental updates to minimize processing
  • Asynchronous operations for non-blocking execution
  • Adaptive context retrieval based on token budget
  • Scheduled background tasks during idle periods

For large codebases (>100,000 LOC), initial indexing may take several minutes, but subsequent operations remain fast and responsive.

Security

  • Isolated Database: Each project uses a dedicated database instance
  • Secure Credentials: TursoDB credentials managed via environment variables
  • Input Validation: All inputs validated with Zod schemas
  • Parameterized Queries: SQL injection protection
  • No External APIs: All processing happens locally

Troubleshooting

Common issues and solutions:

  • Connection Errors: Verify TursoDB credentials and database URL
  • Slow Initial Startup: Normal for large codebases; subsequent startups are faster
  • Missing Context: Check token budget; increase if necessary
  • Tool Errors: Ensure proper conversation ID is being passed between tools
  • Performance Issues: Consider reducing scope of indexed files or increasing cache size

License

This project is licensed under the MIT License - see the LICENSE file for details.


DevContext: Continuous Context for Continuous Progress

安装

TypingMind
前提条件:

Node.js 18+

{
  "mcpServers": {
    "aurda012-devcontext": {
      "command": "npx",
      "args": [
        "-y",
        "devcontext"
      ]
    }
  }
}

将 DevContext: Autonomous Context Awareness Model-Context-Protocol (MCP) Server MCP 与多个 AI 模型配合使用

TypingMind 在工作区级别连接 MCP 工具,因此连接 DevContext: Autonomous Context Awareness Model-Context-Protocol (MCP) Server 后,您就可以在 TypingMind 中搭配不同的 AI 模型使用,无需为每个模型单独设置。 此 MCP 通过您设备上的 TypingMind MCP 连接器在本地运行。

本地连接器设置指南

如果 MCP 服务器需要访问您电脑上的本地文件、应用或私有资源,请选择此方式。

1

打开 MCP 设置

在 TypingMind 中,依次前往“设置”、“高级设置”和“模型上下文协议”,然后选择“设置连接器”。

  1. 在您的浏览器中打开 TypingMind。
  2. 点击“设置”图标。
  3. 进入“高级设置”。
  4. 打开“模型上下文协议”部分。
  5. 点击“设置连接器”,然后选择“此设备”。
TypingMind MCP 连接器设置界面,已选择“此设备”
2

运行连接器命令

选择“此设备”,从 TypingMind 复制命令并在终端中运行。使用 MCP 时,请保持该进程运行。

  1. 复制 TypingMind 显示的设置命令。
  2. 在 macOS 上打开“终端”,或在 Windows 上打开 Windows Terminal。
  3. 粘贴并运行命令。
  4. 如果终端询问您是否继续,请确认安装软件包。
  5. 使用 MCP 工具时,请保持终端窗口及其中的进程运行。
3

将 DevContext: Autonomous Context Awareness Model-Context-Protocol (MCP) Server 添加为服务器

当连接器状态为“就绪”时,点击“编辑服务器”,然后粘贴 MCP 服务器配置。

  1. 等待连接器状态显示为“就绪”。
  2. 点击“编辑服务器”。
  3. 粘贴 DevContext: Autonomous Context Awareness Model-Context-Protocol (MCP) Server MCP 服务器配置。
  4. 保存服务器列表。
  5. 如需确认连接器是否仍处于就绪状态,请刷新。
TypingMind MCP 设置界面,显示正在运行的服务器和“编辑服务器”按钮
{
  "mcpServers": {
    "aurda012-devcontext": {
      "command": "npx",
      "args": [
        "-y",
        "devcontext"
      ]
    }
  }
}
4

在不同模型中使用同一连接

保存服务器列表,打开“插件”,启用 DevContext: Autonomous Context Awareness Model-Context-Protocol (MCP) Server MCP 工具,然后在 TypingMind 中选择任意受支持的 AI 模型,即可在聊天中使用这些工具,或将其分配给智能体。

  1. 在 TypingMind 中打开“插件”页面。
  2. 启用 DevContext: Autonomous Context Awareness Model-Context-Protocol (MCP) Server MCP 工具。
  3. 开始聊天并选择您想使用的 AI 模型。
  4. 在聊天中使用 MCP 工具,或将其分配给 AI 智能体。
  5. 根据需要随时切换到其他 AI 模型,无需重新连接 MCP。
在 TypingMind 聊天中使用已启用的 MCP 工具和选定的 AI 模型
您能使用 DevContext: Autonomous Context Awareness Model-Context-Protocol (MCP) Server 帮我完成这项任务吗?
DevContext: Autonomous Context Awareness Model-Context-Protocol (MCP) Server
当然。我已阅读。
以下是我使用 DevContext: Autonomous Context Awareness Model-Context-Protocol (MCP) Server 得到的结果。

常见问题

DevContext: Autonomous Context Awareness Model-Context-Protocol (MCP) Server MCP 服务器有什么用途?

DevContext: Autonomous Context Awareness Model-Context-Protocol (MCP) Server 是一个 MCP 服务器,可让兼容的 AI 客户端连接外部工具并获取上下文。在 TypingMind 中,只需添加一次此 MCP 服务器,即可在您的 AI 工作区中使用其工具。

可以在 TypingMind 中让多个 AI 模型使用 DevContext: Autonomous Context Awareness Model-Context-Protocol (MCP) Server MCP 吗?

可以。TypingMind 在工作区层面连接 MCP 工具,因此您可以让 Claude、ChatGPT、Gemini 等不同 AI 模型,或您在 TypingMind 中配置的其他模型使用 DevContext: Autonomous Context Awareness Model-Context-Protocol (MCP) Server,而无需为每个模型单独配置 MCP 服务器。

为什么在 TypingMind 中使用 DevContext: Autonomous Context Awareness Model-Context-Protocol (MCP) Server MCP?

TypingMind 将多个 AI 模型、提示词、插件、AI 智能体、API 密钥和 MCP 工具整合到同一个工作区中,是优秀的大语言模型聊天前端之一。连接 DevContext: Autonomous Context Awareness Model-Context-Protocol (MCP) Server 后,您可以在偏好的不同模型中使用其 MCP 工具,同时在 TypingMind 中井然有序地管理聊天工作流程。

如何将 DevContext: Autonomous Context Awareness Model-Context-Protocol (MCP) Server MCP 连接到 TypingMind?

DevContext: Autonomous Context Awareness Model-Context-Protocol (MCP) Server 通过 TypingMind 本地 MCP 连接器运行。当 MCP 服务器需要访问您计算机上的本地文件、桌面应用、命令行工具或私有资源时,这种方式最合适。

DevContext: Autonomous Context Awareness Model-Context-Protocol (MCP) Server MCP 在 TypingMind 中提供哪些工具?

DevContext: Autonomous Context Awareness Model-Context-Protocol (MCP) Server 提供 5 个 MCP 工具,您可以在 TypingMind 的插件页面启用这些工具,然后在聊天中使用,或将其分配给 AI 智能体。

使用 DevContext: Autonomous Context Awareness Model-Context-Protocol (MCP) Server MCP 需要向 TypingMind 提供我的 API 密钥吗?

不需要。TypingMind 采用本地优先的设计,让您自行掌控模型提供商、API 密钥、提示词和 MCP 配置。如果 DevContext: Autonomous Context Awareness Model-Context-Protocol (MCP) Server 需要身份验证,请在创建连接时,为该 MCP 服务器添加所需的请求头、OAuth 设置或本地配置。

相关 MCP 服务器

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇