We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/PranavMishra28/gmail-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
copilot-instructions.md•2.28 KiB
# MCP Gmail Server - Copilot Instructions
This project implements a minimal Model Context Protocol (MCP) server for sending emails through Gmail.
## Project Overview
- **Language**: TypeScript (Node.js)
- **Framework**: MCP TypeScript SDK (@modelcontextprotocol/sdk)
- **Email Provider**: Gmail via Nodemailer
- **Transport**: STDIO (for local MCP client connections)
- **Architecture**: Single tool server with structured input/output
## Key Components
### Core Files
- `src/index.ts` - Main MCP server implementation with send_email tool
- `package.json` - Dependencies and build scripts
- `tsconfig.json` - TypeScript configuration
- `.env.example` - Environment variables template
### MCP Configuration
- `.well-known/mcp.json` - Server discovery manifest
- `.vscode/mcp.json` - VS Code MCP client configuration
- `demo.sh` - Manual testing script for MCP protocol
### Build System
- `npm run build` - Compiles TypeScript to build/
- `npm start` - Runs the compiled server
- `npm run dev` - Development mode with tsx
## MCP Implementation Details
This server follows MCP specification by:
1. **Tool Registration**: Exposes `send_email` tool with Zod schema validation
2. **STDIO Transport**: Uses StdioServerTransport for client communication
3. **Structured Output**: Returns JSON with success/error states and metadata
4. **Environment Security**: Credentials loaded from env vars, never hardcoded
5. **Error Handling**: Comprehensive logging and structured error responses
## Development Guidelines
- Use the MCP TypeScript SDK for all protocol interactions
- Follow the existing error handling patterns
- Log all operations to stderr (stdout reserved for MCP protocol)
- Validate all inputs with Zod schemas
- Return structured output with both text and structured content
- Never hardcode credentials - always use environment variables
## Testing
- Use `./demo.sh` for manual protocol testing
- Use MCP Inspector: `npx @modelcontextprotocol/inspector node build/index.js`
- Integrate with Claude Desktop or other MCP clients
## Dependencies
- `@modelcontextprotocol/sdk` - MCP protocol implementation
- `nodemailer` - Email sending functionality
- `zod` - Runtime type validation and schema definition
- `dotenv` - Environment variable management
- `typescript` + `tsx` - TypeScript development tools