Sagnik-23/MCP_Server
3.2
If you are the rightful owner of MCP_Server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
This project is a Model Context Protocol (MCP) server and client implementation in TypeScript, designed to facilitate interaction with resources and tools, including integration with Google Generative AI.
MCP Server and Client
This project is a Model Context Protocol (MCP) server and client implementation in TypeScript. It allows you to run an MCP server, interact with it using a client, and manage resources and tools such as user creation and querying.
Features
- MCP server with resource and tool definitions
- User management (create, list, etc.)
- Interactive client with prompts for tools, resources, and queries
- Integration with Google Generative AI (Gemini)
- TypeScript-based codebase
Getting Started
Prerequisites
- Node.js (v18+ recommended)
- npm
Installation
- Clone the repository:
git clone <repo-url> cd MCP_Server
- Install dependencies:
npm install
Build
To compile TypeScript to JavaScript:
npm run server:build
Run the Server
To start the MCP server:
npm run server:dev
Run the Client
To start the interactive client:
npm run server:dev
Usage
- The client will prompt you to select actions: Query, Tools, Resources, Prompts, or Exit.
- For tools (e.g., user creation), enter the required fields as prompted.
- For resources, select and provide any required parameters.
- For prompts, interact with AI-powered text generation.
Project Structure
MCP_Server/
āāā src/
ā āāā server.ts # MCP server implementation
ā āāā client.ts # Interactive client
ā āāā data/
ā āāā users.json # User data storage
āāā build/ # Compiled JS output
āāā package.json # Project configuration
āāā tsconfig.json # TypeScript configuration
āāā README.md # Project documentation
Environment Variables
- To use Google Generative AI, set your API key in a
.env
file:GEMINI_API_KEY=your-google-api-key
License
ISC
Author
Sagnik-23