npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@gspinaci/rs-code-docs-mcp

v1.0.0

Published

MCP server for ResearchSpace code documentation and exploration. Ask questions about the codebase and get accurate answers with file references.

Readme

ResearchSpace Code Documentation Helper

A Model Context Protocol (MCP) server that helps you understand and navigate the ResearchSpace codebase. Ask questions about the code and get accurate answers with direct file references.

Purpose

This MCP server is designed to help developers understand the ResearchSpace codebase by:

  • Answering questions about code structure and implementation
  • Finding relevant code sections based on natural language queries
  • Providing direct file references and code snippets
  • Helping locate where specific functionality is implemented

Example Questions

  • "How can I modify the Field Definitions?"
  • "How can I create a field?"
  • "Where does the parsing of a query happen?"
  • "How is authentication implemented?"
  • "Where are the SPARQL queries defined?"

Features

This MCP server provides tools for code documentation and exploration:

Core Tools

1. rs_ping

Returns the server version and operational status.

Parameters: None

Returns:

{
  "version": "1.0.0",
  "status": "operational"
}

Documentation Tools

2. rs_search

Searches the indexed repository using semantic search. Returns relevant code chunks with similarity scores and file references.

Parameters:

  • query (string, required): Search query (natural language or keywords)
  • k (number, optional): Number of results to return (default: 8)
  • scope (string, optional): "repo", "docs", "apps", or "all" (default: "all")

Returns:

{
  "hits": [
    {
      "id": "repo:src/main/java/org/researchspace/api/rest/client/FieldDefinition.java:0",
      "source": "repo",
      "filepath": "src/main/java/org/researchspace/api/rest/client/FieldDefinition.java",
      "chunkId": 0,
      "snippet": "public class FieldDefinition { ... }",
      "score": 0.85,
      "metadata": { ... }
    }
  ],
  "totalHits": 8
}

3. rs_open

Opens and returns the full content of a specific search result chunk by its ID. Use this to get complete context after finding relevant code with rs_search.

Parameters:

  • hitId (string, required): The ID of the search hit to open (from rs_search results)

Returns:

{
  "success": true,
  "content": "Full chunk content here...",
  "metadata": {
    "source": "repo",
    "filepath": "src/main/java/org/researchspace/api/rest/client/FieldDefinition.java",
    "chunkId": 0,
    "totalChunks": 5
  },
  "message": "Chunk retrieved successfully"
}

Documentation Workflow

The recommended workflow for answering code questions is: search → open → answer

  1. Search: Use rs_search with a natural language query to find relevant code
  2. Open: Use rs_open to get full context of the most relevant results
  3. Answer: Provide accurate answers with direct file references

Example Workflow

Question: "How can I modify the Field Definitions?"

// 1. Search for field definition code
rs_search({
  query: "field definition modification create update",
  k: 5,
  scope: "repo"
})

// 2. Open the most relevant result
rs_open({
  hitId: "repo:src/main/java/org/researchspace/api/rest/client/FieldDefinition.java:0"
})

// 3. Provide answer with file reference:
// "Field definitions can be modified in the FieldDefinition.java class located at 
// src/main/java/org/researchspace/api/rest/client/FieldDefinition.java..."

Installation

npm install

Setup

Before first use, run the setup script to prepare the system:

npm run setup

This will:

  1. Clone the repository: Downloads https://github.com/researchspace/researchspace to ~/.cache/rs-mcp/researchspace/ (~500MB-1GB)
  2. Build the vector index: Processes all files, creates chunks, and generates embeddings

Time estimate: 10-20 minutes total

  • Repository clone: 2-5 minutes (depending on internet speed)
  • Initial indexing: 5-15 minutes (depending on CPU)

Note: The embedding model (~90MB) will be downloaded automatically during indexing.

Updating the Index

To refresh the index with the latest ResearchSpace code changes, simply re-run the setup:

npm run setup

This will pull the latest changes from the repository and rebuild the index.

Building

npm run build

Running

npm start

Development

npm run dev

Project Structure

/src
  server.ts          # Main MCP server implementation
  setup.ts           # Setup script for repository and indexing
  rag/               # RAG implementation (vector DB, indexing, search)
/tests               # Test files
README.md
LICENSE

Usage with MCP Clients

Add this server to your MCP client configuration:

{
  "mcpServers": {
    "rs-code-docs": {
      "command": "node",
      "args": ["/path/to/rs_app_builder_mcp/dist/server.js"]
    }
  }
}

Example Questions and Queries

Finding Field Definitions

rs_search({
  query: "How can I modify the Field Definitions?",
  k: 5,
  scope: "repo"
})

Creating Fields

rs_search({
  query: "How can I create a field?",
  k: 5,
  scope: "repo"
})

Query Parsing

rs_search({
  query: "Where does the parsing of a query happen?",
  k: 5,
  scope: "repo"
})

Technologies

  • MCP SDK: Model Context Protocol implementation
  • Vectra: Local vector database for embeddings
  • Xenova Transformers: all-MiniLM-L6-v2 model for text embeddings
  • TypeScript: Type-safe implementation

License

MIT