Skip to main content
Glama

MCP Complete Implementation Guide

by saksham0712
CHATGPT-SETUP.md•4.32 kB
# ChatGPT + MCP Integration Setup Guide šŸŽ‰ **Your ChatGPT integration is now ready!** ## šŸ“‹ Current Status āœ… **MCP Server**: Running on port 3000 āœ… **ChatGPT Proxy**: Running on port 3001 āœ… **Web Interface**: Ready to use āœ… **OpenAI API**: Configured ## šŸš€ How to Use ChatGPT with MCP ### Option 1: Web Interface (Recommended) 1. **Open the ChatGPT interface**: `chatgpt-interface.html` (should have opened automatically) 2. **Start chatting**: The interface connects to your local ChatGPT proxy 3. **Use MCP tools**: Ask ChatGPT to perform file operations, get system info, etc. ### Option 2: API Integration ```bash # Send a POST request to the ChatGPT proxy curl -X POST http://localhost:3001/chat \ -H "Content-Type: application/json" \ -d '{ "messages": [ {"role": "user", "content": "List the files in my MCP directory"} ] }' ``` ## šŸ› ļø Available MCP Tools via ChatGPT When you chat with the AI, it can automatically use these tools: - **šŸ“ read_file** - Read any file on your system - **āœļø write_file** - Create or modify files - **šŸ“‹ list_directory** - Browse directories - **šŸ’» get_system_info** - Get system information - **🌐 fetch_url** - Download web content - **⚔ execute_command** - Run system commands (with security controls) ## šŸ’¬ Example Conversations Try asking ChatGPT: ``` "List the files in my MCP directory" "Read my README.md file and summarize it" "Create a new file called test.txt with some sample content" "Get my current system information" "Fetch the content from https://api.github.com and show me the structure" ``` ## šŸŽÆ How It Works 1. **Your message** → ChatGPT Web Interface 2. **Interface** → ChatGPT Proxy Server (localhost:3001) 3. **Proxy** → OpenAI GPT-4 API (with MCP tools) 4. **GPT-4** → Decides which MCP tools to use 5. **Proxy** → Calls MCP Server (localhost:3000) for tool execution 6. **MCP Server** → Executes the requested operations 7. **Results** → Back to you via the web interface ## šŸ”§ Management Commands ### Start/Stop Services ```powershell # Start MCP Server .\start-mcp-server.ps1 # Start ChatGPT Proxy .\start-chatgpt-proxy.ps1 # Or start both manually node server.js # Terminal 1 (MCP Server) node chatgpt-proxy.js # Terminal 2 (ChatGPT Proxy) ``` ### Check Status ```powershell # Check MCP Server curl http://localhost:3000/health # Check ChatGPT Proxy curl http://localhost:3001/health ``` ## šŸ”’ Security Features - **Sandbox Mode**: File operations restricted to safe directories - **Command Validation**: System commands require confirmation - **API Key Protection**: Stored securely in environment variables - **CORS Protection**: Web interface can only access designated endpoints ## šŸ› ļø Troubleshooting ### Common Issues 1. **"Proxy Disconnected"** - Check if ChatGPT proxy is running: `curl http://localhost:3001/health` - Restart proxy: `node chatgpt-proxy.js` 2. **"OpenAI API Error"** - Verify API key in `.env` file - Check API key has sufficient credits - Ensure key has GPT-4 access 3. **"MCP Tools Not Working"** - Verify MCP server is running: `curl http://localhost:3000/health` - Check server logs for errors 4. **"CORS Error in Browser"** - Make sure you're opening the HTML file directly (not serving via HTTP) - Check browser console for detailed error messages ### Debug Mode ```powershell # Enable debug logging $env:DEBUG = "mcp:*" node chatgpt-proxy.js ``` ## šŸŽ‰ Integration Benefits **Compared to regular ChatGPT:** - āœ… Can read/write your local files - āœ… Can browse your file system - āœ… Can get real-time system information - āœ… Can fetch live web content - āœ… Can execute system commands safely - āœ… Works completely locally (privacy) ## šŸ“š Next Steps 1. **Try the example prompts** in the web interface 2. **Explore file operations** - ask ChatGPT to help organize your files 3. **Use for development** - have ChatGPT read your code and make suggestions 4. **Automate tasks** - use command execution for system automation 5. **Extend functionality** - add custom MCP tools for your specific needs --- **šŸŽŠ Enjoy your enhanced ChatGPT experience with MCP tools!** *Your AI assistant can now interact with your local system safely and powerfully.*

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/saksham0712/MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server