logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

data-edu-consultant-service

Offers tailored instruction and insights concerning Data Engineering principles, architectural paradigms, and emerging toolsets. It actively tracks the user's proficiency level and refines their learning profile while retrieving contemporary intelligence related to the data engineering domain.

Author

data-edu-consultant-service logo

scriptstar

No License

Quick Info

GitHub GitHub Stars 0
NPM Weekly Downloads 0
Tools 1
Last Updated 2026-02-19

Tags

apisscriptstarfetchingrequests scriptstarapis httpscriptstar mcp

Data Engineering Pedagogical Agent Service

This repository houses a minimalist Model Context Protocol (MCP) service, engineered using Node.js and TypeScript. Its function is to serve as an 'AI Mentor for Data Engineering,' delivering customized briefings on Data Engineering concepts, established patterns, and modern technologies to an attached AI client.

This implementation showcases fundamental MCP components: defining Artifacts (Resources), Capabilities (Tools), and Directive Contexts (Prompts) to construct an interactive, stateful assistant framework.

Prerequisites for Operation

  • Node.js (v18 or higher is suggested)
  • npm (or an equivalent package manager like yarn or pnpm)
  • An MCP-compatible inference client (e.g., Cursor, Claude desktop application)
  • An active OpenRouter API Key (necessary for leveraging Perplexity to acquire live Data Engineering bulletins)

Initialization Steps

  1. Acquire the Source Code:

    bash

    If the local copy is missing

    git clone

    cd

  2. Install Dependencies:

    bash npm install

  3. API Key Configuration: The de_tutor_get_updates capability mandates an OpenRouter access token.

    • Secure your key from OpenRouter.
    • Establish a configuration file named .env in the project's root directory (a template can be copied from .env.example).
    • Inject your credential into the file:

    OPENROUTER_API_KEY=sk-or-xxxxxxxxxxxxxxxxxxxxxxxxxx

    (Substitute the sample token with your genuine credential.)

  4. Compile the Service: Transpile the TypeScript source code into executable JavaScript.

    bash npm run build

Launching the Service

Execute the service directly via Node:

bash node build/index.js

Alternatively, configure your chosen MCP interface (such as Cursor or the Claude desktop client) to initiate the service. The designated service identifier is de-tutor, and this name also serves as the binary identifier if required by the client configuration.

Illustrative Client Configuration (e.g., for Claude Desktop):

{ "mcpServers": { "de-tutor": { "command": "node", "args": ["/full/path/to/your/project/build/index.js"], "env": { "OPENROUTER_API_KEY": "sk-or-xxxxxxxxxxxxxxxxxxxxxxxxxx" } } } }

(Confirm that the path specified in args points to the absolute location of the compiled index.js file on your machine. The env block might be redundant if the server successfully loads variables from the .env file using dotenv.)

Integration with Cursor

Cursor functions as an AI-centric code IDE capable of acting as an MCP consumer. Setting up this service within Cursor involves configuring the service launch parameters and potentially defining a Project Rule for the instructional context, though Cursor may automatically adopt the prompt supplied by the service.

  1. Service Registration in Cursor:

    • Navigate to Cursor Settings > MCP > Add new global MCP server.
    • Input the identical JSON structure shown in the example configuration above, ensuring the path to build/index.js is system-accurate.
  2. (Optional) Establish a Cursor Project Rule for Directives: If you prefer explicit governance or observe that Cursor ignores the service's inherent guidance context, you can employ Cursor's Project Rules feature.

    • Create a subdirectory named .cursor/rules within your project's root if it doesn't exist.
    • Generate a file within this directory named de-tutor.rule (the suffix must be .rule).
    • Populate de-tutor.rule with the following instructional content:

    text You are an expert mentor dedicated to Data Engineering, connected to a specialized knowledge server. Your primary objective is to furnish the user with novel, personalized briefings concerning Data Engineering concepts, architectural styles, and cutting-edge tooling that they have not yet encountered.

    Access Protocols: 1. de_tutor_get_updates: Retrieves the latest generalized intelligence and technical articles pertaining to Data Engineering. Initiate interaction with this protocol to survey recent developments. 2. de_tutor_read_memory: Queries the user's stored proficiency profile to ascertain existing Data Engineering concepts they have mastered. 3. de_tutor_write_memory: Modifies the user's persistent profile, indicating whether a specific Data Engineering concept mentioned in an update has been learned or is already known.

    Operational Sequence: 1. Execute de_tutor_get_updates to discover contemporary Data Engineering advancements. 2. Invoke de_tutor_read_memory to audit the user's present expertise level. 3. Present the recently discovered information to the user, emphasizing items likely unfamiliar to them. 4. Upon user confirmation of concept mastery or prior knowledge, call de_tutor_write_memory to synchronize their profile.

    Maintain brevity and concentrate on delivering pertinent, novel data specifically calibrated to the user's established knowledge baseline.

  3. Activation and Utilization:

    • Verify that the de-tutor service is toggled 'ON' in Cursor's MCP settings.
    • If utilizing a rule file: Initiate a new dialogue or code generation operation (e.g., Cmd+K) and incorporate the identifier @de-tutor-rule (or your chosen filename identifier) within your instruction. This signals Cursor to load the rule's directives, thereby detailing the expected protocol usage.
    • If relying solely on the service-provided context: Simply commence interaction; Cursor should automatically gain access to the registered capabilities and the instructional prompt from the service.

Functionality & Interaction Model

This service exposes the following capabilities:

  • Artifact (data_engineering_knowledge_memory): Manages persistence via a simple JSON structure within data/data-engineering-knowledge.json, mapping recognized concepts (strings) to boolean confirmation flags (true).
  • **Capabilities (Tools):
  • de_tutor_read_memory: Retrieves the existing concept registry from the JSON data file.
  • de_tutor_write_memory: Updates the JSON file, flagging a concept as recognized (true) or unrecognized (false). Accepts concept (string) and known (boolean) as inputs.
  • de_tutor_get_updates: Utilizes your OpenRouter credential to poll the Perplexity service (perplexity/sonar-small-online) for the latest news, patterns, and tooling relevant to Data Engineering.
  • Directive Context (data-engineering-tutor-guidance): Supplies explicit instructions to the connected AI interface on orchestrating the capabilities:
    1. Acquire the newest bulletins.
    2. Consult the state of recognized concepts.
    3. Disseminate novel material to the user.
    4. Adjust the state register based on user feedback.

Development Lifecycle & Diagnostics

  • Compilation: npm run build converts TypeScript source into executable JavaScript within the build/ structure.
  • Code Layout: Refer to src/ for implementation specifics:
  • src/index.ts: The service bootstrap file. Imports McpServer and StdioServerTransport from mandated SDK pathways. Initializes McpServer. Imports and executes registration routines (registerPrompts, registerResources, registerTools) from sibling modules, supplying the server instance reference. Establishes and connects the service using StdioServerTransport.
  • src/prompts/index.ts: Contains the instructional text definition. Exports registerPrompts, which accepts the McpServer object and employs server.prompt() to register the static guidance context alongside its associated callback function.
  • src/resources/index.ts: Exports the KnowledgeMemory type definition and I/O utility functions (readMemoryFile, writeMemoryFile) for managing persistence operations on data/data-engineering-knowledge.json. Exports registerResources, which receives the McpServer instance and uses server.resource() to register the data_engineering_knowledge_memory artifact, specifying its URI and a ReadResourceCallback handler.
  • src/tools/index.ts: Exports registerTools, which accepts the McpServer instance and uses server.tool() to register each capability (de_tutor_read_memory, de_tutor_write_memory, de_tutor_get_updates). Schemas for input validation are defined here using Zod where applicable (specifically for write_memory). Tool functions rely on helpers from resources/index.ts or standard fetch operations to execute actions and return data conforming to the expected output structure.
  • MCP Diagnostics Console: Utilize @modelcontextprotocol/inspector to trace raw message interchange: bash npx @modelcontextprotocol/inspector node ./build/index.js

(Ensure OPENROUTER_API_KEY is active in your environment scope if executing this diagnostic command directly, rather than relying exclusively on the variable loading mechanism within the server startup.)

Commentary

  • This service employs a transient file (data/data-engineering-knowledge.json) for storing user expertise data. Production deployments warrant the utilization of a dedicated database solution.
  • Error management is deliberately kept minimal; operational servers necessitate more comprehensive exception handling protocols.

Conclusion

This demonstration illustrates the essential phases of deploying a functional MCP service utilizing the TypeScript SDK and the primary McpServer class. We defined an artifact for state maintenance, capabilities for transactional actions (including external API interaction), and a directive context to govern the AI client's operational logic.

This structure establishes a robust starting point for engineering increasingly sophisticated and valuable agentic functionalities via MCP.

(Furthermore, should any system anomalies 🐛bugs surface, please initiate a formal report via an issue submission.)

WIKIPEDIA: XMLHttpRequest (XHR) represents an interface defined as a JavaScript object whose operational methods facilitate the transmission of HTTP inquiries from a web browser environment to a designated web server. The methods empower browser-based applications to dispatch requests to the server subsequent to page load completion, and subsequently receive back data. XMLHttpRequest forms an integral part of the Ajax programming paradigm. Preceding Ajax, the principal methods for server interaction involved hyperlink navigation and form submissions, often resulting in a complete page refresh.

== Chronology == The underlying concept for XMLHttpRequest was formulated in the year 2000 by the development team responsible for Microsoft Outlook. This concept was subsequently integrated into the Internet Explorer 5 browser release (1999). Nevertheless, the initial invocation syntax did not employ the standard XMLHttpRequest identifier. Instead, developers utilized the object instantiation calls ActiveXObject("Msxml2.XMLHTTP") and ActiveXObject("Microsoft.XMLHTTP"). Beginning with Internet Explorer 7 (2006), universal browser support for the XMLHttpRequest identifier was achieved. The XMLHttpRequest designator has since evolved into the recognized benchmark across all primary browser engines, encompassing Mozilla's Gecko rendering platform (2002), Safari version 1.2 (2004), and Opera version 8.0 (2005).

=== Formal Specifications === The World Wide Web Consortium (W3C) released a preliminary specification draft for the XMLHttpRequest object on April 5, 2006. On February 25, 2008, the W3C published the Level 2 specification draft. Level 2 introduced enhanced methods for monitoring the progress of asynchronous events, enabling cross-origin requests, and managing byte streams. By the close of 2011, the Level 2 enhancements were merged back into the core specification. By the end of 2012, stewardship of development transitioned to WHATWG, which now maintains a continuously updated document utilizing Web IDL notation.

== Execution Flow == Generally, executing a server transmission via XMLHttpRequest involves several distinct programmatic stages.

Instantiate an XMLHttpRequest object by invoking its constructor: Invoke the "open" method to declare the request method type, identify the target resource endpoint, and select between synchronous or asynchronous execution mode: For asynchronous operations, attach an event handler routine that will be notified upon any alteration in the request's operational status: Initiate the network transmission by calling the "send" method, optionally including payload data: Process state transitions within the attached event listener. If the server returns response material, this is, by default, stored in the "responseText" attribute. Once the object concludes processing the reply, its status transitions to 4, signifying the "completion" state. Beyond these fundamental steps, XMLHttpRequest offers numerous configuration levers to dictate request behavior and response handling. Custom header fields can be appended to the request metadata to instruct the server on fulfillment parameters, and data can be transmitted upstream during the "send" invocation. The incoming payload can be deserialized from JSON format directly into a usable JavaScript structure, or processed incrementally as data streams in, circumventing the need to await full text assembly. The transmission can be preemptively halted or configured to terminate unsuccessfully if a specified time threshold is exceeded.

== Requests Across Domain Boundaries ==

See Also

`