Commit Graph
31 Commits
Author SHA1 Message Date
gurixandClaude a78ad4cdd8 chore: Archive update-mcp-server-for-organization-members OpenSpec change
Archive completed OpenSpec change after successful implementation and testing.
The MCP server has been updated to support organization members with all
11 tasks completed and 57 tests passing.

Changes:
- Moved change from openspec/changes/ to openspec/changes/archive/
- Archived as 2025-12-04-update-mcp-server-for-organization-members
- Skipped spec updates (--skip-specs) as functionality is already covered
  by existing mcp-integration spec

Implementation summary:
- Updated TypeScript MCP server with memberType and companyName support
- Added proper pytest tests for organization members (4 new tests)
- All integration and e2e tests passing
- MCP tools now handle both INDIVIDUAL and ORGANIZATION member types

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 16:48:04 +01:00
gurixandClaude da9286be73 test: Reorganize organization member tests into proper pytest structure
Fix test organization by moving ad-hoc test scripts into proper pytest tests
following project conventions. Added 4 new tests to integration and e2e layers
to provide comprehensive coverage for organization members.

Changes:
- tests/integration/test_member_mutations.py:
  * Add test_create_organization_member - Tests creating organizations with companyName
  * Add test_create_organization_with_contact_person - Tests organizations with contact info
  * Import MemberType from models and schemas

- tests/integration/test_member_queries.py:
  * Add test_query_mixed_member_types - Tests querying both individual and organization members
  * Import MemberType from models

- tests/e2e/test_graphql_api.py:
  * Add test_introspect_member_type_enum - Tests GraphQL introspection for MemberType enum
  * Verifies INDIVIDUAL and ORGANIZATION enum values

Deleted improper test files:
- test_organization_members.py (root) - Ad-hoc script using httpx directly
- test_mcp_changes.sh (root) - Shell script for MCP server testing

Test results:
- All 57 tests pass (up from 53)
- Organization members now tested at all layers: unit, integration, and e2e
- Tests follow pytest conventions with async patterns and shared fixtures
- Integrated with CI/CD pipeline (proper test/ directory structure)

The proper test structure ensures:
1. Unit tests validate business logic (validation layer)
2. Integration tests verify GraphQL resolvers and database persistence
3. E2E tests confirm full HTTP request/response flows
4. All tests use shared fixtures from conftest.py

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 16:28:05 +01:00
gurixandClaude d32dc99c66 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>
2025-12-04 13:44:01 +01:00
gurixandClaude 82a2a46a8e docs: Create OpenSpec proposal for MCP server organization member support
Add comprehensive proposal to update the TypeScript MCP server to support
organization members. The GraphQL backend was updated in the
feat/organization-member-support branch to add memberType and companyName
fields, but the MCP server tools still assume all members are individuals.

Proposal includes:
- Detailed design for updating tool definitions and GraphQL queries
- Member formatting logic to distinguish individuals from organizations
- Comprehensive spec deltas with 22 scenarios covering all use cases
- 11 implementation tasks

All changes are contained in a single file: src/mcp_server.ts

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 13:34:56 +01:00
gurixandClaude 5053b80998 feat: Add organization member support with memberType field
Implements support for both individual persons and organizations as members.

Changes:
- Added MemberType enum (INDIVIDUAL, ORGANIZATION) to distinguish member types
- Added member_type column to database (defaults to INDIVIDUAL for backward compatibility)
- Added company_name field for organizations
- Made first_name nullable (required for individuals, optional for organizations)
- Implemented conditional validation:
  - INDIVIDUAL members require first_name
  - ORGANIZATION members require company_name
- Updated GraphQL schema with new memberType and companyName fields
- Updated all resolvers to handle new fields and validation
- Added comprehensive unit tests for validation logic
- Updated existing tests to work with new fields
- All 53 tests passing

Technical notes:
- Using memberType instead of 'kind' to avoid GraphQL introspection conflicts
- Using native_enum=False for SQLite compatibility
- Using batch_alter_table for SQLite ALTER COLUMN compatibility
- Backward compatible: existing members automatically become INDIVIDUAL type

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 12:15:55 +01:00
gurix 630af11403 Removed old tests from the python version of the mcp server. 2025-12-04 08:36:04 +01:00
gurix 5eba0c4dd2 OpenSpec updated 2025-12-04 08:34:12 +01:00
gurix 2a6584078c refactor: Convert MCP server implementation from Python to TypeScript. 2025-12-01 20:46:50 +01:00
gurixandClaude 7d96a657b3 docs: update project structure in README
Expand the project structure section to include all directories and files with detailed descriptions. The updated structure now shows:
- Complete src/ layout with all modules
- Test suite organization (unit, integration, e2e, mcp)
- Migration and script directories
- OpenSpec structure with all spec categories
- Configuration files

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-21 20:38:08 +01:00
gurixandClaude 48d84bdc0a chore: archive add-pytest-tests change
Archive the completed pytest test suite implementation change. The change has been moved to the archive and the project-setup spec has been updated with all test requirements and scenarios.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-21 20:32:09 +01:00
gurixandClaude 4c9f2eb462 docs: mark all pytest implementation tasks as completed
All 57 tests passing across 4 test categories:
- Unit tests: 20/20 ✓
- Integration tests: 20/20 ✓
- E2E tests: 5/5 ✓
- MCP server tests: 12/12 ✓

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-21 20:20:13 +01:00
gurixandClaude 2f9865abde feat: add comprehensive pytest test suite
Implemented full test coverage for existing features:
- Unit tests (18 tests): Validation logic for email, phone, firstName
- Integration tests (29 tests): Member model, GraphQL queries/mutations
- E2E tests (5 tests): Complete GraphQL API flows over HTTP
- MCP server tests (12 tests): All 6 MCP tools

Test organization:
- tests/unit/ - Pure logic tests
- tests/integration/ - Database and resolver tests
- tests/e2e/ - Full API request/response tests
- tests/mcp/ - MCP server tool tests
- tests/conftest.py - Shared fixtures

All 57 tests passing ✓

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-21 19:56:03 +01:00
gurixandClaude e041684acd docs: add OpenSpec proposal for pytest test suite
This proposal adds comprehensive pytest testing for all existing features:
- Unit tests for validation logic
- Integration tests for database operations and GraphQL resolvers
- E2E tests for complete API flows
- MCP server tests for all 6 tools

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-21 13:56:38 +01:00
gurixandClaude dd772db298 chore: archive add-graphql-tools change
Archive completed change proposal to openspec/changes/archive/.
Updated specs with new GraphQL introspection and MCP tool requirements:

- graphql-api: Added GraphQL Introspection Support requirement
- mcp-integration: Added 3 requirements for GraphQL tools
  - Get GraphQL Schema Tool
  - Execute GraphQL Query Tool
  - Tool Input Schema for GraphQL Execution

All requirements include comprehensive scenarios and are now part
of the active specification.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-21 12:08:58 +01:00
gurixandClaude 172898b244 chore: mark all tasks completed in add-graphql-tools
All implementation tasks for the GraphQL tools feature have been
completed and tested. Ready for archiving.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-21 12:08:34 +01:00
gurixandClaude 703bb201e9 chore: add local MCP server configuration
Add .mcp.json for local MCP server testing and development.
Configures the clubber MCP server with uv run to ensure proper
virtual environment activation and connection to local GraphQL API.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-21 12:04:36 +01:00
gurixandClaude d220c27b67 docs: add OpenSpec proposal for GraphQL tools
Add comprehensive proposal for general GraphQL tools in MCP server:
- proposal.md: Problem statement and impact analysis
- tasks.md: Implementation checklist
- specs/mcp-integration/spec.md: 3 new MCP tool requirements
- specs/graphql-api/spec.md: GraphQL introspection requirement

Proposal introduces get_graphql_schema and execute_graphql_query tools
to enable AI agents to discover and interact with the GraphQL API
dynamically for complex tasks beyond dedicated member tools.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-21 11:58:55 +01:00
gurixandClaude a94f7d0321 feat: add general GraphQL tools to MCP server
Add two new MCP tools for flexible GraphQL operations:
- get_graphql_schema: Expose complete schema via introspection
- execute_graphql_query: Execute arbitrary queries and mutations

These tools complement existing dedicated member tools by enabling
AI agents to:
- Discover the GraphQL schema dynamically
- Construct custom queries with specific field selection
- Handle complex queries without requiring new dedicated tools
- Work with query variables for parameterized operations

The implementation reuses the existing GraphQLClient class and
adds proper error handling for API unavailability and validation
errors. Schema introspection is formatted as human-readable text
while query results are returned as formatted JSON.

Updated README.md with:
- Documentation for both new tools
- Usage examples for schema discovery and query execution
- Guidance on when to use general vs dedicated tools

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-21 11:15:22 +01:00
gurix 3cc9e9283f fix: remove accidentally tracked worktree directory 2025-11-20 14:28:34 +01:00
gurixandClaude 093cba8f6d chore: archive add-mcp-server proposal and create mcp-integration spec
Archived the add-mcp-server proposal to archive/2025-11-20-add-mcp-server/
and created the mcp-integration capability spec with 7 requirements.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-20 14:28:02 +01:00
gurixandClaude 7c5201498b docs: update MCP server config with tested uv run command
Update the Claude Code MCP configuration to use 'uv run' instead of
direct python execution. This ensures the virtual environment and
dependencies are properly activated when the MCP server starts.

Also added a note about working directory requirements.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-20 14:26:27 +01:00
gurix c86c6d9a64 chore: mark all add-mcp-server tasks as completed 2025-11-20 13:57:53 +01:00
gurixandClaude 8d14e7e75a feat: add MCP server for AI-powered member management
This change implements a Model Context Protocol (MCP) server that
enables AI assistants to manage society members through natural
language interactions.

Changes:
- Add MCP server implementation (src/mcp_server.py)
- Implement 4 core tools:
  * list_members - Query all members
  * get_member - Get specific member by ID
  * create_member - Create new member
  * update_member - Update member information
- Add mcp and httpx dependencies to pyproject.toml
- Update README with comprehensive MCP server documentation
- Create OpenSpec proposal in openspec/changes/add-mcp-server/

The MCP server connects to the GraphQL API via HTTP and provides
structured tools that abstract away GraphQL complexity.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-20 13:54:52 +01:00
gurixandClaude 5bb27bdadf chore: archive add-graphql-member-api proposal and create capability specs
Archive completed GraphQL API implementation proposal:
- Move proposal to openspec/changes/archive/2025-11-20-add-graphql-member-api/
- Create capability specs in openspec/specs/:
  - database-layer: SQLAlchemy async with Alembic migrations
  - graphql-api: Strawberry GraphQL with FastAPI integration
  - member-crud: Member management with conditional validation
  - project-setup: Python 3.11+ with uv package manager

All 73 tasks completed and validated.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-20 13:26:43 +01:00
gurixandClaude 2688616ec6 docs: mark all tasks as completed in add-graphql-member-api proposal
All 73 validation checkboxes marked as completed after successful implementation and testing.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-20 13:25:13 +01:00
gurixandClaude e27701e9bf docs: update README with API server setup and usage instructions
Add comprehensive documentation for running the GraphQL API:
- Complete setup instructions (dependencies, migrations, seeding)
- Server startup commands and endpoints
- Member data model documentation
- GraphQL query and mutation examples
- curl command examples

Replace placeholder "when implemented" comments with actual working instructions.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-20 12:53:09 +01:00
gurixandClaude 1559c48104 feat: implement GraphQL member management API
Implement complete member management system with GraphQL API per OpenSpec proposal.
Only firstName is required; all other fields are optional with conditional validation.

Key features:
- GraphQL CRUD operations (create, read, update, delete members)
- SQLAlchemy 2.0 async with SQLite database
- Alembic database migrations
- Conditional validation (email/phone validated only when provided)
- Member fields: firstName (required), lastName, address, email, phone (all optional)
- Database seed script with sample member
- FastAPI with Strawberry GraphQL integration

Implementation details:
- Python 3.11+ with uv package manager
- Async database sessions throughout
- Proper error handling and validation
- Code quality: black, isort, ruff
- Comprehensive end-to-end testing completed

All 20 tasks from OpenSpec proposal completed successfully.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-20 12:21:13 +01:00
gurixandClaude f3f5e0282c feat: add OpenSpec proposal for GraphQL member API
Create comprehensive OpenSpec proposal for implementing a minimal GraphQL API
for member management with flexible validation requirements.

Key features:
- Only firstName required for member creation
- Conditional validation (email/phone format validated only when provided)
- Full CRUD operations via GraphQL
- SQLite database with Alembic migrations
- FastAPI + Strawberry GraphQL integration

Includes 4 capability specs:
- project-setup: Python project structure with uv dependency management
- database-layer: SQLAlchemy async models with nullable fields
- graphql-api: Strawberry schema with minimal required fields
- member-crud: Business logic with conditional validation

Implementation broken down into 20 discrete tasks across 5 phases.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-20 11:29:06 +01:00
gurixandClaude 88a82b1e4e chore: archive add-initial-readme change and create project-documentation spec
Move completed change to archive (2025-11-19-add-initial-readme) and create
project-documentation specification with 4 requirements for README maintenance.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-19 22:29:22 +01:00
gurixandClaude 57b37c366d docs: add initial README and OpenSpec proposal
Add comprehensive README.md documenting project purpose, architecture,
tech stack, and development workflow. Includes OpenSpec proposal
(add-initial-readme) with project documentation specification.

The README describes current state only (early development phase) and
serves as entry point for developers and AI assistants.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-19 22:26:28 +01:00
gurix df76a89c1b Initial commit 2025-11-19 22:13:05 +01:00