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

mcp-type-introspection-service

Delivers immediate lookup capabilities into TypeScript API schematics for generative AI models, facilitating swift comprehension and leveraging of novel interfaces without iterative model fine-tuning. Substantially boosts developer velocity by enabling AI entities to interrogate and conform to previously unseen application programming interfaces.

Author

mcp-type-introspection-service logo

yWorks

MIT License

Quick Info

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

Tags

apistypescripttypescribetypescript apitypescribe providesapi documentation

npm version

MCP-TypeIntrospectionService - A Model Context Protocol Gateway for AI API Knowledge

The Challenge

Modern Large Language Models (LLMs) exhibit remarkable proficiency in code synthesis and augmenting development workflows. Nevertheless, their utility is fundamentally constrained by the corpus of APIs they encountered during pre-training. This creates a significant impediment to integrating nascent toolsets, bespoke SDKs, or proprietary internal interfaces—AI systems lack the requisite knowledge to interact with these systems correctly.

While providing LLMs with access to source artifacts (where source code is available) or documentation artifacts (such as TypeScript definition files) is one recourse, this approach does not scale effectively for expansive APIs. AI agents require a more streamlined mechanism for absorbing API context. Injecting the entirety of documentation into the prompt context for every interaction is resource-intensive, impractical, and yields suboptimal performance.

Consequences:

  • Major or proprietary software interfaces remain inaccessible to automated reasoning systems.
  • Engineers are forced into manual intervention, guiding the LLM or supplying requisite usage examples.
  • The pace of innovation is hampered by the delay between an interface's release and its functional incorporation by artificial intelligence coding companions.

The Concept

This repository presents an open-source realization of the Model Context Protocol (MCP)—a standardized mechanism engineered to supply AI agents with dynamic, contextualized data access. Here, the data served is API specification metadata, currently focused predominantly on TypeScript type definitions.

Our Objectives:

  1. To process and index TypeScript (and analogous) interface definitions into a structured, machine-interpretable format.
  2. To disseminate this context dynamically to LLMs via established agents such as Claude, Cursor, or bespoke frontends following the MCP specification.
  3. To empower autonomous agent operations by enabling LLMs to query, formulate execution plans, and adapt to unfamiliar interface contracts without requiring model recalibration.

Enabled Capabilities

  • Immediate, 'out-of-the-box' integration of new APIs into AI-powered coding assistants.
  • Accelerated assimilation cycles for proprietary or newly launched software development kits.
  • A tangible progression toward constructing more self-governing, context-aware programming agents.

System Overview

This service furnishes a pathway for AI entities to expediently explore and comprehend unfamiliar TypeScript interfaces. It ingests TypeDoc-generated JSON artifacts and exposes them via a suite of specialized query endpoints. These endpoints permit agents to resolve symbols, retrieve granular details on specific components, and map inter-component relationships.

Operational Features

  • TypeDoc Synchronization: Reads and indexes TypeDoc JSON documentation to enable high-speed retrieval.
  • Extensive Query Modalities: Offers a comprehensive suite of retrieval tools for navigating TypeScript interfaces.
  • MCP Compliance: Adheres strictly to the Model Context Protocol for frictionless integration with AI control planes.

Available Query Tools

The backend exposes the following interface interrogation mechanisms:

  • search_symbols: Locates defined symbols based on name, with optional filtering by structural kind.
  • get_symbol_details: Retrieves exhaustive information pertaining to a specified symbol identifier.
  • list_members: Enumerates the public and private methods and properties of a class or interface structure.
  • get_parameter_info: Fetches detailed specifications for function arguments.
  • find_implementations: Discovers concrete implementations of abstract types or interface contracts.
  • search_by_return_type: Pinpoints functions that yield a designated data type.
  • search_by_description: Executes keyword searches within associated JSDoc commentary blocks.
  • get_type_hierarchy: Visualizes the inheritance and interface implementation lineage.
  • find_usages: Tracks the points within the definition set where a specific type or function is referenced.

Implementation Guide

Prerequisites

  • A recent Node.js runtime environment.
  • npm package manager.

Setup Instructions

  1. Obtain the source code via Git clone.
  2. Resolve project dependencies: bash npm install

Execution

  1. First, generate the TypeDoc JSON output for your target TypeScript codebase:

    bash npx typedoc --json docs/api.json --entryPointStrategy expand path/to/your/typescript/files

    If your input is solely an existing .d.ts file, you can generate the necessary JSON artifact as follows:

    Draft a distinct tsconfig.docs.json configuration:

    { "extends": "./tsconfig.json", "files": ["existing.d.ts"], "typedocOptions": { "entryPoints": ["existing.d.ts"], "json": "docs/api.json", "pretty": false } }

    Then execute TypeDoc:

    bash npx typedoc --tsconfig tsconfig.docs.json

  2. Compile the project source code:

    bash npm run build

  3. Launch the MCP gateway service:

    bash npx @modelcontextprotocol/inspector node ./dist/mcp-server/cli.js run-server docs/api.json

  4. Configure an AI assistant agent to interact with this newly initialized gateway.

    For example, when setting up cline within VSCode, define the MCP endpoint in cline_mcp_settings.json like this:

    { "mcpServers": { "typescribe": { "command": "npx", "args": [ "-y", "mcp-typescribe@latest", "run-server", "" ], "env": {} } } }

  5. Activate the gateway and approve the exposed tools (if prompted). Instruct the AI agent to invoke the designated "typescribe" tool to begin querying your API documentation structure.

Directory Layout

  • src/sample-api/: A representative TypeScript interface suite utilized for validation—it employs atypical nomenclature to verify the agent's resistance to producing fictitious API elements.
  • src/mcp-server/: The core implementation of the MCP gateway
  • utils/: Helper utilities for common tasks
  • schemas/: JSON Schemas defining the structure of the MCP tooling calls
  • core/: Essential operational logic
  • server.ts: The main entry point for the MCP gateway listener
  • index.ts: Exports available library components
  • cli.ts: The entry point for the executable command-line interface
  • tests/: Unit and integration validation suites for the API query logic

Maintenance

Running Validation Suites

bash npm test

Compilation

bash npm run build

Licensing

MIT

Copyright 2025 yWorks GmbH - https://www.yworks.com WIKIPEDIA: XMLHttpRequest (XHR) is an API in the form of a JavaScript object whose methods transmit HTTP requests from a web browser to a web server. The methods allow a browser-based application to send requests to the server after page loading is complete, and receive information back. XMLHttpRequest is a component of Ajax programming. Prior to Ajax, hyperlinks and form submissions were the primary mechanisms for interacting with the server, often replacing the current page with another one.

== History == The concept behind XMLHttpRequest was conceived in 2000 by the developers of Microsoft Outlook. The concept was then implemented within the Internet Explorer 5 browser (1999). However, the original syntax did not use the XMLHttpRequest identifier. Instead, the developers used the identifiers ActiveXObject("Msxml2.XMLHTTP") and ActiveXObject("Microsoft.XMLHTTP"). As of Internet Explorer 7 (2006), all browsers support the XMLHttpRequest identifier. The XMLHttpRequest identifier is now the de facto standard in all the major browsers, including Mozilla's Gecko layout engine (2002), Safari 1.2 (2004) and Opera 8.0 (2005).

=== Standards === The World Wide Web Consortium (W3C) published a Working Draft specification for the XMLHttpRequest object on April 5, 2006. On February 25, 2008, the W3C published the Working Draft Level 2 specification. Level 2 added methods to monitor event progress, allow cross-site requests, and handle byte streams. At the end of 2011, the Level 2 specification was absorbed into the original specification. At the end of 2012, the WHATWG took over development and maintains a living document using Web IDL.

== Usage == Generally, sending a request with XMLHttpRequest has several programming steps.

Create an XMLHttpRequest object by calling a constructor: Call the "open" method to specify the request type, identify the relevant resource, and select synchronous or asynchronous operation: For an asynchronous request, set a listener that will be notified when the request's state changes: Initiate the request by calling the "send" method: Respond to state changes in the event listener. If the server sends response data, by default it is captured in the "responseText" property. When the object stops processing the response, it changes to state 4, the "done" state. Aside from these general steps, XMLHttpRequest has many options to control how the request is sent and how the response is processed. Custom header fields can be added to the request to indicate how the server should fulfill it, and data can be uploaded to the server by providing it in the "send" call. The response can be parsed from the JSON format into a readily usable JavaScript object, or processed gradually as it arrives rather than waiting for the entire text. The request can be aborted prematurely or set to fail if not completed in a specified amount of time.

== Cross-domain requests ==

In the early development of the World Wide Web, it was found possible to brea

See Also

`