We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Jaz-spec/alex_mcp_workshop'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
LEARNINGS.md•1.98 KiB
# MCP Git Analysis Server - Learnings
## Date: [Current Session]
### MCP Protocol
- **Resource URI Type Issue**: The `uri` parameter in `@app.read_resource()` comes as a Pydantic `AnyUrl` object, NOT a plain string
- Error: `'AnyUrl' object has no attribute 'startswith'`
- Solution: Convert to string first using `uri_str = str(uri)` before using string methods
- This is important for any URI parsing or comparison operations
- Always convert Pydantic types to native Python types when using standard library methods
### GitPython Library
- [Document GitPython usage patterns]
### Challenges & Solutions
- **Problem**: MCP Inspector error - `'AnyUrl' object has no attribute 'startswith'`
- **Cause**: MCP SDK passes URIs as Pydantic `AnyUrl` objects, not plain strings
- **Solution**: Convert to string with `str(uri)` before string operations
- **Prevention**: Always be aware of Pydantic type wrappers when working with MCP SDK parameters
### Best Practices Discovered
- [Document good patterns that emerge]
### Linux/Unix Commands
- `chmod +x filename` - Makes a file executable on Unix-based systems (macOS/Linux)
- Adds execution permissions to the file
- Allows running file directly as `./filename` instead of `python3 filename`
- Not strictly necessary for MCP Inspector testing since you run it as `python3 server.py` anyway
- Useful for production deployment or when the file has a shebang (`#!/usr/bin/env python3`)
### Testing Insights
- [Document testing approaches and results]
### Performance Considerations
- [Document any performance issues or optimizations]
### Things to Research Further
- [Document items that need more investigation]
### Time Management
- [Track time spent on different tasks]
### Mistakes & How to Avoid Them
- [Document errors made and prevention strategies]
---
## Session Log
[Add timestamped notes as you work]
### [Timestamp] - Initial Setup
- Created tracking files
- Read project requirements
- Task: Build MCP server for git repository analysis