Releases: atototo/api-lab-mcp
Releases · atototo/api-lab-mcp
v0.2.0 - Session-Based Authentication Support(세션 기반 인증 시스템 추가)
🎉 Session Authentication is Here!
API Forge now supports cookie-based session authentication, making it easier to test legacy systems and session-protected APIs.
✨ What's New
🍪 Cookie-Based Session Authentication
- Full support for session cookies (JSESSIONID, PHPSESSID, etc.)
- CSRF token handling with custom session headers
- Multiple concurrent session management
🛠️ New MCP Tools
test_with_session- Test APIs with session cookiesset_session- Configure session authentication
🐛 Bug Fixes
- Fixed cookie parsing logic to handle all cookie formats correctly
- Resolved Cookie header transmission issue where sessions weren't being sent
- Removed unnecessary URL encoding that was breaking cookie values
📈 Improvements
- Session authentication now integrated alongside Bearer, Basic, API Key, and OAuth2
- Enhanced error messages for expired or invalid sessions
- Better handling of Set-Cookie headers in responses
💻 Quick Start
Using Session Authentication
// Test with session cookie
await test_with_session({
url: "https://api.example.com/user/profile",
cookies: "JSESSIONID=ABC123DEF456",
method: "GET"
})
// Set session with CSRF token
await set_session({
cookies: "JSESSIONID=ABC123; XSRF-TOKEN=xyz789",
headers: {
"X-XSRF-TOKEN": "xyz789"
}
})
📋 Supported Session Types
- Java applications (JSESSIONID)
- PHP applications (PHPSESSID)
- ASP.NET applications (ASP.NET_SessionId)
- Express.js (connect.sid)
- Custom session implementations
🔧 Installation & Setup
1. Update your API Forge:
git pull
npm install
npm run build
2. Update MCP server:
claude mcp remove api-forge-local
claude mcp add api-forge-local node ~/path/to/api-forge/dist/mcp/server.js
3. Restart Claude Desktop
📊 Testing Results
Successfully tested with:
- ✅ Spring Boot applications
- ✅ Legacy Java systems
- ✅ Session + CSRF protected endpoints
- ✅ Multi-factor authentication flows
🤝 Contributors
- @atototo - Project maintainer
📝 Full Changelog
Added
- SessionManager class for comprehensive cookie management
- Session authentication type in AuthConfig
- MCP tools for session-based testing
- Session expiration detection
Fixed
- Cookie parsing now handles complex cookie strings
- Direct Cookie header injection for reliable transmission
- Removed URL encoding that corrupted session IDs
Changed
- AuthenticationService now supports 5 authentication types
- Improved error handling for authentication failures
---
Full PR: #[1]
Documentation: ./docs/session-based-authentication.md🎉 세션 인증 기능 추가!
API Forge가 이제 쿠키 기반 세션 인증을 지원합니다. 레거시 시스템과 세션 보호 API를 더욱 쉽게 테스트할 수 있습니다.
✨ 새로운 기능
🍪 쿠키 기반 세션 인증
- 세션 쿠키 완벽 지원 (JSESSIONID, PHPSESSID 등)
- 커스텀 세션 헤더를 통한 CSRF 토큰 처리
- 다중 세션 동시 관리 기능
🛠️ 새로운 MCP 도구
test_with_session- 세션 쿠키를 사용한 API 테스트set_session- 세션 인증 설정
🐛 버그 수정
- 모든 쿠키 형식을 올바르게 처리하도록 쿠키 파싱 로직 수정
- 세션이 전송되지 않던 Cookie 헤더 전송 문제 해결
- 쿠키 값을 손상시키던 불필요한 URL 인코딩 제거
📈 개선사항
- Bearer, Basic, API Key, OAuth2와 함께 세션 인증 통합
- 만료되거나 유효하지 않은 세션에 대한 에러 메시지 개선
- 응답의 Set-Cookie 헤더 처리 개선
💻 빠른 시작
세션 인증 사용하기
// 세션 쿠키로 테스트
await test_with_session({
url: "https://api.example.com/user/profile",
cookies: "JSESSIONID=ABC123DEF456",
method: "GET"
})
// CSRF 토큰과 함께 세션 설정
await set_session({
cookies: "JSESSIONID=ABC123; XSRF-TOKEN=xyz789",
headers: {
"X-XSRF-TOKEN": "xyz789"
}
})
📋 지원되는 세션 타입
- Java 애플리케이션 (JSESSIONID)
- PHP 애플리케이션 (PHPSESSID)
- ASP.NET 애플리케이션 (ASP.NET_SessionId)
- Express.js (connect.sid)
- 커스텀 세션 구현
🔧 설치 및 설정
1. API Forge 업데이트:
git pull
npm install
npm run build
2. MCP 서버 업데이트:
claude mcp remove api-forge-local
claude mcp add api-forge-local node ~/path/to/api-forge/dist/mcp/server.js
3. Claude Desktop 재시작
📊 테스트 결과
성공적으로 테스트 완료:
- ✅ Spring Boot 애플리케이션
- ✅ 레거시 Java 시스템
- ✅ 세션 + CSRF 보호 엔드포인트
- ✅ 다단계 인증 플로우
🤝 기여자
- @atototo - 프로젝트 메인테이너
📝 전체 변경사항
추가됨
- 포괄적인 쿠키 관리를 위한 SessionManager 클래스
- AuthConfig에 세션 인증 타입 추가
- 세션 기반 테스트를 위한 MCP 도구
- 세션 만료 감지 기능
수정됨
- 복잡한 쿠키 문자열을 처리하도록 쿠키 파싱 개선
- 안정적인 전송을 위한 Cookie 헤더 직접 주입
- 세션 ID를 손상시키던 URL 인코딩 제거
변경됨
- AuthenticationService가 이제 5가지 인증 타입 지원
- 인증 실패에 대한 에러 처리 개선
---
전체 PR: #[1]
문서: ./docs/session-based-authentication.md