feat: Update MCP server to support organization members

Implement organization member support in the TypeScript MCP server to align
with the GraphQL backend changes from support-organization-members.

Changes to src/mcp_server.ts:
- Update create_member tool definition:
  * Add memberType enum field (INDIVIDUAL, ORGANIZATION)
  * Add companyName field for organizations
  * Remove firstName from required fields
  * Update description to explain conditional requirements
- Update update_member tool definition:
  * Add memberType and companyName fields
  * Update description to mention type transitions
- Update all GraphQL queries and mutations:
  * Add memberType and companyName to listMembers query
  * Add memberType and companyName to getMember query
  * Add memberType and companyName to createMember mutation
  * Add memberType and companyName to updateMember mutation
- Update formatMember function:
  * Check memberType to determine formatting approach
  * Show "Type: Individual" or "Type: Organization"
  * For individuals: display "Name: firstName lastName"
  * For organizations: display "Company: companyName"
  * For organizations with contact: display "Contact Person: firstName lastName"
  * Maintain backward compatibility (defaults to INDIVIDUAL if missing)

Testing:
- All 11 implementation tasks completed
- Created test script test_organization_members.py
- Verified individual member creation with validation
- Verified organization member creation with companyName
- Verified organization with contact person
- Verified member listing with mixed types
- Verified GraphQL schema introspection includes MemberType enum
- Verified validation: INDIVIDUAL requires firstName, ORGANIZATION requires companyName

All tests passed successfully. MCP server now fully supports both individual
and organization members with proper formatting and validation.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-12-04 13:44:01 +01:00
co-authored by Claude
parent 82a2a46a8e
commit d32dc99c66
4 changed files with 276 additions and 19 deletions
@@ -1,15 +1,15 @@
# Tasks: Update MCP Server for Organization Members
- [ ] Update `create_member` tool definition with memberType and companyName fields <!-- id: 0 -->
- [ ] Update `update_member` tool definition with memberType and companyName fields <!-- id: 1 -->
- [ ] Add memberType and companyName to listMembers GraphQL query <!-- id: 2 -->
- [ ] Add memberType and companyName to getMember GraphQL query <!-- id: 3 -->
- [ ] Add memberType and companyName to createMember mutation response <!-- id: 4 -->
- [ ] Add memberType and companyName to updateMember mutation response <!-- id: 5 -->
- [ ] Update formatMember function to distinguish between individual and organization members <!-- id: 6 -->
- [ ] Test individual member creation (verify existing behavior) <!-- id: 7 -->
- [ ] Test organization member creation (verify new behavior) <!-- id: 8 -->
- [ ] Test member listing with mixed member types (verify formatting) <!-- id: 9 -->
- [ ] Verify GraphQL schema introspection includes MemberType enum <!-- id: 10 -->
- [x] Update `create_member` tool definition with memberType and companyName fields <!-- id: 0 -->
- [x] Update `update_member` tool definition with memberType and companyName fields <!-- id: 1 -->
- [x] Add memberType and companyName to listMembers GraphQL query <!-- id: 2 -->
- [x] Add memberType and companyName to getMember GraphQL query <!-- id: 3 -->
- [x] Add memberType and companyName to createMember mutation response <!-- id: 4 -->
- [x] Add memberType and companyName to updateMember mutation response <!-- id: 5 -->
- [x] Update formatMember function to distinguish between individual and organization members <!-- id: 6 -->
- [x] Test individual member creation (verify existing behavior) <!-- id: 7 -->
- [x] Test organization member creation (verify new behavior) <!-- id: 8 -->
- [x] Test member listing with mixed member types (verify formatting) <!-- id: 9 -->
- [x] Verify GraphQL schema introspection includes MemberType enum <!-- id: 10 -->
**Note**: All changes are in a single file: `src/mcp_server.ts`