-
Notifications
You must be signed in to change notification settings - Fork 0
Description
β coaiapy-mcp v0.1.4 - Ready for Testing
Status: READY β
Version: 0.1.4
Date: 2025-10-30
Branch: copilot/update-files-in-coaiapy-mcp
What's New in v0.1.4
π Comment Support (3 New Tools)
coaia_fuse_comments_list- List/filter commentscoaia_fuse_comments_get- Get comment by IDcoaia_fuse_comments_create- Create comments
π§ Version Management Fix
- Server now reports correct version (was 0.1.0, now 0.1.4)
- Enhanced bump.py to sync all 3 version files
- Single source of truth for version
Files Modified in This PR
Core Implementation
-
/src/coaiapy/coaiapy/cofuse.py(lines 289-362)- Enhanced
get_comments()with filtering - New
get_comment_by_id()function - Enhanced
post_comment()with object attachment
- Enhanced
-
/src/coaiapy/coaiapy-mcp/coaiapy_mcp/tools.py(lines 20-32, 521-741)- Added 3 new comment tool functions
- Updated imports and exports
-
/src/coaiapy/coaiapy-mcp/coaiapy_mcp/server.py(lines 223-263)- Registered 3 new MCP tools
- Dynamic version import
Build & Release
/src/coaiapy/bump.py- Enhanced version bumping/src/coaiapy/coaiapy-mcp/release.sh- Updated git commit/src/coaiapy/coaiapy-mcp/__init__.py(line 15) - Version 0.1.4
Documentation
/src/coaiapy/COMMENT_SUPPORT_SUMMARY.md- Implementation details/src/coaiapy/coaiapy-mcp/CHANGELOG.md- Version history/src/coaiapy/coaiapy-mcp/TEST_PLAN_v0.1.4.md- Test scenarios
Testing Checklist
Before Testing
- Verify MCP server installed:
pip show coaiapy-mcp - Check version:
python -c "from coaiapy_mcp import __version__; print(__version__)" - Ensure Langfuse credentials configured in
~/.coaia - Restart Claude Code to pick up new MCP tools
Core Tests
- List all comments
- Create comment on trace
- Create comment on observation
- Get comment by ID
- Filter comments by object type
- Filter comments by object ID
- Test pagination (page, limit)
Regression Tests
- Existing trace tools still work
- Existing prompts tools still work
- Redis tash/fetch still works
- Server reports v0.1.4
Error Handling
- Non-existent comment ID returns error
- Invalid parameters handled gracefully
Quick Test Command
# In new Claude Code session with MCP access:
await mcp__coaiapy__coaia_fuse_comments_list({})Expected output: JSON with comments list or {"success": true, "comments": ...}
Available MCP Tools (Total: 14)
Redis (2)
coaia_tashcoaia_fetch
Traces (3)
coaia_fuse_trace_createcoaia_fuse_add_observationcoaia_fuse_trace_view
Prompts (2)
coaia_fuse_prompts_listcoaia_fuse_prompts_get
Datasets (2)
coaia_fuse_datasets_listcoaia_fuse_datasets_get
Score Configs (2)
coaia_fuse_score_configs_listcoaia_fuse_score_configs_get
Comments (3) β¨ NEW
coaia_fuse_comments_listcoaia_fuse_comments_getcoaia_fuse_comments_create
Installation for Testing
Option 1: Editable Install (Recommended for Testing)
cd /src/coaiapy/coaiapy-mcp
pip install -e .Option 2: Build and Install
cd /src/coaiapy/coaiapy-mcp
make clean && make build
pip install dist/coaiapy_mcp-0.1.4-py3-none-any.whlOption 3: From PyPI (after release)
pip install --upgrade coaiapy-mcpExpected Server Output on Start
INFO - Starting coaiapy-mcp server...
INFO - MCP Server created: coaiapy-mcp v0.1.4
Known Working Configuration
- Python: 3.10+
- Dependencies:
mcp>=1.0.0coaiapy>=0.2.54langfuse>=2.0.0redis>=5.0.0
Test Data Examples
Sample Trace ID
"test-trace-2025-10-30-001"Sample Comment Text
"Test comment for v0.1.4 validation"Sample Filters
{
"object_type": "trace",
"object_id": "your-trace-id",
"page": 1,
"limit": 10
}Success Indicators
β
Version 0.1.4 reported in logs
β
14 MCP tools available (list_tools)
β
Comment creation returns comment ID
β
Comment retrieval returns full data
β
Filtering returns correct subset
β
No errors in server logs
Support Files
- Test Plan:
TEST_PLAN_v0.1.4.md - Implementation:
COMMENT_SUPPORT_SUMMARY.md - Changelog:
CHANGELOG.md - OpenAPI Spec:
/src/coaiapy/references/openapi.yml(lines 517-693)
If Issues Arise
- Check server logs for errors
- Verify Langfuse API credentials
- Ensure coaiapy package is up to date:
pip install --upgrade coaiapy - Test direct Python access:
from coaiapy.cofuse import get_comments - Review TEST_PLAN_v0.1.4.md for detailed test scenarios
Ready to test! π
Just reboot session with MCP access and start testing the new comment functionality.
coaiapy-mcp v0.1.4 Testing Plan
Pre-Testing Setup
1. Install/Reinstall Package
cd /src/coaiapy/coaiapy-mcp
pip install -e .2. Verify Version
python -c "from coaiapy_mcp import __version__; print(__version__)"
# Expected: 0.1.43. Start MCP Server (if needed manually)
python -m coaiapy_mcp.serverTest Cases for Comment Support
Test 1: List All Comments
Tool: mcp__coaiapy__coaia_fuse_comments_list
# No filters - list all comments
await mcp__coaiapy__coaia_fuse_comments_list({})
# Expected: JSON with list of comments or empty listTest 2: Create Comment on Trace
Tool: mcp__coaiapy__coaia_fuse_comments_create
Prerequisites: Need a valid trace_id (create one first if needed)
# First create a trace
trace_id = "test-trace-" + str(uuid.uuid4())
await mcp__coaiapy__coaia_fuse_trace_create({
"trace_id": trace_id,
"name": "Test Trace for Comments"
})
# Then add comment
await mcp__coaiapy__coaia_fuse_comments_create({
"text": "This is a test comment on a trace",
"object_type": "trace",
"object_id": trace_id
})
# Expected: Success response with comment data including IDTest 3: List Comments for Specific Trace
Tool: mcp__coaiapy__coaia_fuse_comments_list
# Using trace_id from Test 2
await mcp__coaiapy__coaia_fuse_comments_list({
"object_type": "trace",
"object_id": trace_id
})
# Expected: List containing the comment we just createdTest 4: Get Comment by ID
Tool: mcp__coaiapy__coaia_fuse_comments_get
Prerequisites: Get comment_id from Test 2 or Test 3 response
await mcp__coaiapy__coaia_fuse_comments_get({
"comment_id": "<comment_id_from_previous_test>"
})
# Expected: Single comment object with all detailsTest 5: Create Comment on Observation
Tool: mcp__coaiapy__coaia_fuse_comments_create
# First create observation
obs_id = "test-obs-" + str(uuid.uuid4())
await mcp__coaiapy__coaia_fuse_add_observation({
"observation_id": obs_id,
"trace_id": trace_id,
"name": "Test Observation for Comments"
})
# Add comment to observation
await mcp__coaiapy__coaia_fuse_comments_create({
"text": "Great observation! Performance looks good.",
"object_type": "observation",
"object_id": obs_id
})
# Expected: Success with comment dataTest 6: Filter Comments by Author
Tool: mcp__coaiapy__coaia_fuse_comments_list
await mcp__coaiapy__coaia_fuse_comments_list({
"author_user_id": "your-user-id"
})
# Expected: Comments filtered by authorTest 7: Pagination Test
Tool: mcp__coaiapy__coaia_fuse_comments_list
# First page, limit 2
await mcp__coaiapy__coaia_fuse_comments_list({
"page": 1,
"limit": 2
})
# Second page, limit 2
await mcp__coaiapy__coaia_fuse_comments_list({
"page": 2,
"limit": 2
})
# Expected: Paginated resultsTest 8: Create Comment without Object Attachment
Tool: mcp__coaiapy__coaia_fuse_comments_create
# Generic comment (not attached to any object)
await mcp__coaiapy__coaia_fuse_comments_create({
"text": "This is a standalone comment"
})
# Expected: Success - comment created without object linkageRegression Tests (Verify Existing Features Still Work)
Test 9: Verify Trace Creation
await mcp__coaiapy__coaia_fuse_trace_create({
"trace_id": "regression-test-trace",
"name": "Regression Test"
})Test 10: Verify Prompts List
await mcp__coaiapy__coaia_fuse_prompts_list({})Test 11: Verify Redis Tash/Fetch
await mcp__coaiapy__coaia_tash({
"key": "test-key",
"value": "test-value"
})
await mcp__coaiapy__coaia_fetch({
"key": "test-key"
})Version Verification Test
Test 12: Check Server Version
Expected: Server should report version 0.1.4 when starting
Look for log output:
MCP Server created: coaiapy-mcp v0.1.4
Error Handling Tests
Test 13: Get Non-Existent Comment
await mcp__coaiapy__coaia_fuse_comments_get({
"comment_id": "non-existent-id-12345"
})
# Expected: Error response with appropriate messageTest 14: Invalid Object Type
await mcp__coaiapy__coaia_fuse_comments_list({
"object_type": "invalid_type"
})
# Expected: Error or empty listSuccess Criteria
β
All 14 tests pass without errors
β
Server reports version 0.1.4
β
Comment CRUD operations work correctly
β
Filtering and pagination work as expected
β
Existing features remain functional
β
Error handling is graceful
Quick Test Script
import uuid
# Quick end-to-end test
trace_id = f"test-{uuid.uuid4()}"
# 1. Create trace
await mcp__coaiapy__coaia_fuse_trace_create({
"trace_id": trace_id,
"name": "Quick Test"
})
# 2. Add comment
result = await mcp__coaiapy__coaia_fuse_comments_create({
"text": "Quick test comment",
"object_type": "trace",
"object_id": trace_id
})
# 3. List comments for this trace
comments = await mcp__coaiapy__coaia_fuse_comments_list({
"object_type": "trace",
"object_id": trace_id
})
print("β
Quick test passed!" if comments else "β Test failed")Notes for Testing Session
- Langfuse Credentials: Ensure
.coaiaconfig has valid credentials - Redis: Ensure Redis is running if testing tash/fetch
- Clean State: May want to test with a fresh Langfuse project
- Observation: Watch for any deprecation warnings or errors in logs
Test Plan Version: 1.0
Package Version: 0.1.4
Date: 2025-10-30
issue #48