mcp-client-typescript

This project implements an MCP server in Node.js that provides a tool to search and fetch documentation snippets for popular AI/ML libraries. It uses Google to search for the latest documentation and handles timeouts and search failures gracefully.

GitHub Stars

0

User Rating

Not Rated

Favorites

0

Views

54

Forks

0

Issues

0

README
# MCP Docs Server

This project implements a Model Context Protocol (MCP) server in Node.js that provides a tool to search and fetch documentation snippets for popular AI/ML libraries.

---

## πŸš€ Features

βœ… MCP-compliant server (using `@modelcontextprotocol/sdk`)  
βœ… Tool: **get_docs**  
βœ… Searches Google for latest docs using Serper API  
βœ… Supports:
- LangChain
- LlamaIndex
- OpenAI

βœ… Returns plain text from documentation pages  
βœ… Handles timeouts and search failures gracefully  

---

## πŸ“ Project Structure

mcp-docs-server/
β”œβ”€β”€ server.js # The MCP server implementation
β”œβ”€β”€ .env # Environment variables
└── README.md # This file


---

## βš™οΈ Setup

1. **Clone the repository**  
   ```bash
   git clone <repo-url>
   cd mcp-docs-server
  1. Install dependencies

    npm install
    
  2. Create a .env file

    SERPER_API_KEY=your_serper_api_key
    
  3. Run the MCP server

    node server.js
    

πŸ› οΈ Usage

The server exposes one tool:

get_docs
  • Description:
    Searches the latest documentation for a given query and library.

  • Arguments:

    • query (string): e.g. "Chroma DB"
    • library (string): one of "langchain", "llama-index", "openai"
  • Returns:
    Plain text content fetched from the search results.

Example usage from a compatible MCP client:

node client.js path/to/server.js

πŸ“¦ Dependencies
  • @modelcontextprotocol/sdk
  • dotenv
  • httpx
  • jsdom

πŸ“ Notes
  • The MCP server uses the Serper API for Google search.
  • To get a Serper API key, visit serper.dev.

🀝 Contributing

Feel free to open issues or submit pull requests!


πŸ“„ License

MIT License.


πŸ”— Links