个性化MCP
STDIO统一个人数据中心MCP服务器
统一个人数据中心MCP服务器
A unified personal data hub built on MCP (Model Context Protocol) that allows AI assistants to access your digital life from multiple platforms, providing truly personalized and contextual interactions.
📖 中文文档: README_zh.md
Clone the repository
git clone https://github.com/YangLiangwei/PersonalizationMCP.git cd PersonalizationMCP
Install dependencies
📖 See detailed installation instructions: Installation and Setup
Configure your API keys
cp config.example config # Edit config file with your actual API keys
Add to Cursor settings
📖 See detailed MCP configuration: Cursor Configuration
Due to the complexity of bilibili-api dependencies (especially lxml compilation issues), installation requires specific steps. Choose one of the methods below:
# 1. Create conda environment conda create -n personalhub python=3.12 conda activate personalhub # 2. Install lxml via conda (avoids compilation issues) conda install lxml # 3. Install remaining packages pip install bilibili-api --no-deps pip install -r requirements.txt
# 1. Install uv if not already installed # Visit: https://docs.astral.sh/uv/getting-started/installation/ # 2. Create environment and install core dependencies uv venv uv sync source .venv/bin/activate # On Windows: .venv\Scripts\activate # 3. Install bilibili-api and its dependencies separately (due to version conflicts) uv pip install lxml # Install lxml first (uses precompiled wheel) uv pip install bilibili-api --no-deps # Install bilibili-api without dependencies uv pip install aiohttp beautifulsoup4 colorama PyYAML brotli urllib3 # Install required dependencies
# 1. Create virtual environment python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate # 2. Install packages in specific order to avoid compilation issues pip install lxml # Install lxml first (uses precompiled wheel) pip install bilibili-api --no-deps # Install bilibili-api without dependencies pip install -r requirements.txt # Install all other dependencies
⚠️ Important: The bilibili-api package has complex dependency requirements that can cause compilation failures on some systems. The multi-step installation approach ensures compatibility by installing lxml first, then bilibili-api without its conflicting dependencies, and finally all other required packages.
Copy the example configuration file and fill in your credentials:
cp config.example config
Then edit the config file with your actual API keys and tokens.
📖 Detailed setup guide: platforms/steam/README.md | 中文指南
Quick summary: Get Steam API key and User ID, then configure:
STEAM_API_KEY=your_steam_api_key_here STEAM_USER_ID=your_steam_user_id_here
📖 Detailed setup guide: platforms/youtube/README.md | 中文指南
Quick summary:
Configuration:
YOUTUBE_API_KEY=your_youtube_api_key_here # OAuth2 tokens are managed automatically after setup
📖 Detailed setup guide: platforms/bilibili/README.md | 中文指南
Quick summary: Extract cookies from your browser after logging into Bilibili
Configuration:
BILIBILI_SESSDATA=your_bilibili_sessdata_cookie BILIBILI_BILI_JCT=your_bilibili_bili_jct_cookie BILIBILI_BUVID3=your_bilibili_buvid3_cookie
📖 Detailed setup guide: platforms/spotify/README.md | 中文指南
Quick summary:
Configuration:
SPOTIFY_CLIENT_ID=your_spotify_client_id_here SPOTIFY_CLIENT_SECRET=your_spotify_client_secret_here SPOTIFY_REDIRECT_URI=https://example.com/callback # OAuth2 tokens are managed automatically after authentication
📖 Detailed setup guide: platforms/reddit/README.md | 中文指南
Quick summary:
Configuration:
REDDIT_CLIENT_ID=your_reddit_client_id_here REDDIT_CLIENT_SECRET=your_reddit_client_secret_here REDDIT_REDIRECT_URI=http://localhost:8888/callback # OAuth2 tokens are managed automatically after authentication
Add the MCP server to your Cursor settings:
If using conda:
{ "mcpServers": { "personalhub": { "command": "/path/to/your/conda/envs/personalhub/bin/python", "args": ["/absolute/path/to/your/project/server.py"], "env": { "STEAM_API_KEY": "your_steam_api_key", "STEAM_USER_ID": "your_steam_user_id", "YOUTUBE_API_KEY": "your_youtube_api_key", "BILIBILI_SESSDATA": "your_bilibili_sessdata", "BILIBILI_BILI_JCT": "your_bilibili_bili_jct", "BILIBILI_BUVID3": "your_bilibili_buvid3", "REDDIT_CLIENT_ID": "your_reddit_client_id", "REDDIT_CLIENT_SECRET": "your_reddit_client_secret" } } } }
If using uv:
{ "mcpServers": { "personalhub": { "command": "uv", "args": ["run", "python", "/absolute/path/to/your/project/server.py"], "env": { "STEAM_API_KEY": "your_steam_api_key", "STEAM_USER_ID": "your_steam_user_id", "YOUTUBE_API_KEY": "your_youtube_api_key", "BILIBILI_SESSDATA": "your_bilibili_sessdata", "BILIBILI_BILI_JCT": "your_bilibili_bili_jct", "BILIBILI_BUVID3": "your_bilibili_buvid3", "REDDIT_CLIENT_ID": "your_reddit_client_id", "REDDIT_CLIENT_SECRET": "your_reddit_client_secret" } } } }
If using pip with virtual environment:
{ "mcpServers": { "personalhub": { "command": "/absolute/path/to/your/project/venv/bin/python", "args": ["/absolute/path/to/your/project/server.py"], "env": { "STEAM_API_KEY": "your_steam_api_key", "STEAM_USER_ID": "your_steam_user_id", "YOUTUBE_API_KEY": "your_youtube_api_key", "BILIBILI_SESSDATA": "your_bilibili_sessdata", "BILIBILI_BILI_JCT": "your_bilibili_bili_jct", "BILIBILI_BUVID3": "your_bilibili_buvid3", "REDDIT_CLIENT_ID": "your_reddit_client_id", "REDDIT_CLIENT_SECRET": "your_reddit_client_secret" } } } }
Note: For YouTube OAuth2 tokens, we recommend using automatic token management. No need to add YOUTUBE_ACCESS_TOKEN in the above configuration. The system will automatically read and refresh tokens from the youtube_tokens.json file.
This system implements intelligent YouTube OAuth2 token management with the following features:
The system automatically handles all token management - no manual maintenance required!
get_steam_library() - Get your game library with statisticsget_steam_recent_activity() - Get recent gaming activityget_steam_friends() - Get your Steam friends listget_steam_profile() - Get Steam profile informationget_player_achievements(app_id) - Get achievements for a specific gameget_user_game_stats(app_id) - Get detailed game statisticsget_friends_current_games() - See what games your friends are playingcompare_games_with_friend(friend_steamid) - Compare game librariesget_friend_game_recommendations(friend_steamid) - Get game recommendationssearch_youtube_videos(query) - Search for videosget_video_details(video_id) - Get detailed video informationget_channel_info(channel_id) - Get channel informationget_trending_videos() - Get trending videosget_youtube_subscriptions() - Get your subscriptions (OAuth2 required)get_youtube_playlists() - Get your playlists (OAuth2 required)get_youtube_liked_videos() - Get your liked videos (OAuth2 required)refresh_youtube_token() - Manually refresh OAuth2 tokenget_youtube_token_status() - Check OAuth2 token statusget_bilibili_user_info(uid) - Get user profile informationget_my_bilibili_profile() - Get your own profilesearch_bilibili_videos(keyword) - Search for videosget_bilibili_video_info(bvid) - Get detailed video informationget_bilibili_user_videos(uid) - Get videos uploaded by a userget_bilibili_following_list() - Get your following listget_bilibili_watch_history() - Get your watch historyget_bilibili_favorites() - Get your favorite videosget_bilibili_liked_videos() - Get your liked videosget_bilibili_coin_videos() - Get videos you've given coins toget_bilibili_toview_list() - Get your "to view later" listAuthentication & Configuration (7 tools):
test_spotify_credentials() - Test API credentialssetup_spotify_oauth() - Initialize OAuth flowcomplete_spotify_oauth() - Complete OAuth authenticationget_spotify_token_status() - Get token statusrefresh_spotify_token() - Manual token refreshMusic Discovery & Social (9 tools):
get_current_user_profile() - Get your Spotify profileget_user_top_items() - Get top artists/tracksget_user_recently_played() - Get recently played musicget_followed_artists() - Get followed artistsfollow_artists_or_users() / unfollow_artists_or_users() - Social featuresLibrary & Playlists (6 tools):
get_user_saved_tracks() / get_user_saved_albums() - Library managementget_user_saved_shows() / get_user_saved_episodes() - Podcast contentget_current_user_playlists() / get_playlist_items() - Playlist operationsAuthentication & Configuration (6 tools):
test_reddit_credentials() - Test API credentialssetup_reddit_oauth() - Initialize OAuth flowcomplete_reddit_oauth() - Complete OAuth authenticationget_reddit_token_status() - Get token statusrefresh_reddit_token() - Manual token refreshauto_refresh_reddit_token_if_needed() - Auto token managementAccount Information (6 tools):
get_user_subreddits() - Get subscribed communitiesget_user_trophies() - Get Reddit trophies and achievementsget_user_preferences() - Get account settingsget_user_karma_breakdown() - Get karma distributionget_moderated_subreddits() - Get moderated communitiesget_contributor_subreddits() - Get contributor permissionsContent & Activity (10 tools):
get_user_submitted_posts() - Get submitted postsget_user_comments() - Get comment historyget_user_overview() - Get mixed activity timelineget_saved_content() - Get saved posts/commentsget_hidden_posts() - Get hidden contentget_upvoted_content() - Get upvoted contentget_downvoted_content() - Get downvoted contentMessaging (3 tools):
get_inbox_messages() - Get inbox messagesget_unread_messages() - Get unread messagesget_sent_messages() - Get sent messagestest_connection() - Test if MCP server is workingget_personalization_status() - Get overall platform statustest_steam_credentials() - Test Steam API configurationtest_youtube_credentials() - Test YouTube API configurationtest_bilibili_credentials() - Test Bilibili configurationtest_spotify_credentials() - Test Spotify API configurationtest_reddit_credentials() - Test Reddit API configurationIf using conda:
conda activate personalhub python server.py
If using uv:
uv run python server.py
If using pip with virtual environment:
source venv/bin/activate # On Windows: venv\Scripts\activate python server.py
Use these tools to test your setup:
# Test individual platforms test_steam_credentials() test_youtube_credentials() test_bilibili_credentials() test_reddit_credentials() # Check overall status get_personalization_status()
platform_mcp.py file@mcp.tool() decoratorserver.pyconfig, .env, myinfo.json, and youtube_tokens.json are in .gitignoreQ: Bilibili cookies not working? A: Cookies expire regularly. Re-extract them from your browser and update your config.
Q: Steam API rate limits? A: Steam API has rate limits. Avoid frequent calls and implement reasonable delays.
Q: YouTube API quota exceeded? A: YouTube API has daily quotas. You can request quota increases or optimize your usage.
Q: YouTube OAuth2 token expired?
A: The system automatically refreshes expired tokens. If manual refresh is needed, use refresh_youtube_token().
Q: Can I use only some platforms? A: Yes! You can configure only the platforms you want to use. Missing credentials won't cause errors.
Q: How to verify my configuration?
A: Use the test tools or call get_personalization_status() to check all platforms.
Contributions are welcome! Here's how you can help:
git checkout -b feature/amazing-featuregit commit -m 'Add amazing feature'git push origin feature/amazing-featureWant to add support for a new platform? Follow these steps:
platform_mcp.py file (e.g., spotify_mcp.py)@mcp.tool() decoratorserver.pyThis project is licensed under the MIT License - see the LICENSE file for details.
If you find this project useful, please consider giving it a star on GitHub!
Made with ❤️ for connecting your digital life with AI