fix: Scaffolding improvements and Redis multi-tenancy support#106
Merged
Conversation
Scaffolding Fixes (from canary project feedback): - Remove workspace path aliases from vitest.config.ts template (CRITICAL) - Add support for scaffolding into current directory with "." - Add port configuration documentation in vitest.system.config.ts - Fix system tests failing out-of-the-box (CORS + NODE_ENV issues) - Refactor index.ts to reduce cognitive complexity Redis Multi-Tenancy Enhancement: - Add REDIS_KEY_PREFIX environment variable for multi-app isolation - Implement normalizeKeyPrefix() helper with automatic colon separator - Create DRY getRedisKeyPrefix() utility used across all factories - Update all 6 Redis stores to support key prefixing - Document in all .env templates with default value 'mcp-persistence' - Backward compatible: empty prefix by default Impact: - Scaffolded projects now have passing tests (16/16) - Multiple MCP apps can share same Redis instance without conflicts - Example: REDIS_KEY_PREFIX=mcp-main creates mcp-main:oauth:client: keys 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
This PR addresses scaffolding issues discovered during canary project testing and adds Redis key prefix support for multi-tenant deployments.
Part 1: Scaffolding Fixes
Issue #1: Workspace path aliases breaking module resolution (CRITICAL)
@mcp-typescript-simple/tools: '../tools/src') that only work in monorepo environmentsresolve.aliasconfiguration - packages now resolve from node_modulesIssue #2: Cannot scaffold into existing directory
npx create-mcp-typescript-simple@next . --yesnow worksIssue #3: Port configuration documentation
Issue #4: System tests failing out-of-the-box
Code Quality
Part 2: Redis Multi-Tenancy Support
Problem
Multiple MCP apps sharing the same Redis instance had key conflicts:
mcp-typescript-simpleandmcp-typescript-simple-canarywrite tooauth:client:abc123Solution
Added
REDIS_KEY_PREFIXenvironment variable with automatic normalization:mcp-main→mcp-main:(colon separator added automatically)mcp-persistenceImpact
Can now run multiple MCP apps on same Redis instance:
Testing
Files Changed: 26
Config & Core:
packages/config/src/storage-config.ts- Added REDIS_KEY_PREFIX schemapackages/persistence/src/stores/redis/redis-utils.ts- Added DRY helpersRedis Stores (6 files):
Factories (6 files):
Scaffolding Templates (8 files):
Other:
packages/create-mcp-typescript-simple/src/index.ts- Current directory support + refactoringpackages/create-mcp-typescript-simple/src/generator.ts- Allow current directory scaffoldingCHANGELOG.md- Added v0.9.1-rc.2 release notesRelease Plan
After merge, release as v0.9.1-rc.2 for canary project testing.
🤖 Generated with Claude Code