Spaces:
Sleeping
Sleeping
update files
Browse files- .gitignore +1 -0
- Dockerfile +40 -0
- mcp_output/README_MCP.md +134 -0
- mcp_output/analysis.json +169 -0
- mcp_output/env_info.json +18 -0
- mcp_output/mcp_logs/llm_statistics.json +11 -0
- mcp_output/mcp_logs/run_log.json +69 -0
- mcp_output/mcp_plugin/__init__.py +0 -0
- mcp_output/mcp_plugin/__pycache__/mcp_service.cpython-311.pyc +0 -0
- mcp_output/mcp_plugin/adapter.py +145 -0
- mcp_output/mcp_plugin/main.py +13 -0
- mcp_output/mcp_plugin/mcp_service.py +85 -0
- mcp_output/requirements.txt +5 -0
- mcp_output/start_mcp.py +30 -0
- mcp_output/tests_smoke/mcp_import_min.py +6 -0
.gitignore
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
*.DS_Store
|
Dockerfile
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use Python 3.11 slim image as base
|
| 2 |
+
FROM python:3.11-slim
|
| 3 |
+
|
| 4 |
+
# Set working directory
|
| 5 |
+
WORKDIR /app
|
| 6 |
+
|
| 7 |
+
# Install system dependencies
|
| 8 |
+
RUN apt-get update && apt-get install -y \
|
| 9 |
+
git \
|
| 10 |
+
build-essential \
|
| 11 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 12 |
+
|
| 13 |
+
# Copy the entire vaderSentiment MCP project
|
| 14 |
+
COPY . /app
|
| 15 |
+
|
| 16 |
+
# Copy MCP service requirements
|
| 17 |
+
COPY mcp_output/requirements.txt /app/requirements.txt
|
| 18 |
+
|
| 19 |
+
# Install Python dependencies
|
| 20 |
+
RUN pip install --no-cache-dir -r /app/requirements.txt
|
| 21 |
+
|
| 22 |
+
# Install FastAPI and Uvicorn for HTTP server (already included in fastmcp, but explicit for clarity)
|
| 23 |
+
RUN pip install --no-cache-dir fastapi uvicorn
|
| 24 |
+
|
| 25 |
+
# Create output directories with write permissions
|
| 26 |
+
RUN mkdir -p /app/mcp_output/mcp_logs \
|
| 27 |
+
/app/mcp_output/output \
|
| 28 |
+
&& chmod -R 777 /app/mcp_output/mcp_logs \
|
| 29 |
+
&& chmod -R 777 /app/mcp_output/output
|
| 30 |
+
|
| 31 |
+
# Set environment variables
|
| 32 |
+
ENV PYTHONUNBUFFERED=1
|
| 33 |
+
ENV MCP_TRANSPORT=http
|
| 34 |
+
ENV MCP_PORT=7860
|
| 35 |
+
|
| 36 |
+
# Expose port (Hugging Face uses 7860 by default)
|
| 37 |
+
EXPOSE 7860
|
| 38 |
+
|
| 39 |
+
# Start MCP service in HTTP mode
|
| 40 |
+
CMD ["python", "/app/mcp_output/start_mcp.py"]
|
mcp_output/README_MCP.md
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# VADER Sentiment Analysis Plugin
|
| 2 |
+
|
| 3 |
+
## Overview
|
| 4 |
+
|
| 5 |
+
VADER (Valence Aware Dictionary and sEntiment Reasoner) is a lexicon and rule-based sentiment analysis tool specifically designed for analyzing sentiments expressed in social media text. This plugin provides an integration of VADER for sentiment analysis tasks, enabling users to evaluate the sentiment of textual data efficiently.
|
| 6 |
+
|
| 7 |
+
Key features include:
|
| 8 |
+
- **Lexicon-based sentiment analysis**: Predefined sentiment scores for words and phrases.
|
| 9 |
+
- **Emoji sentiment processing**: Built-in support for analyzing emojis.
|
| 10 |
+
- **Rule-based sentiment adjustment**: Context-aware sentiment evaluation.
|
| 11 |
+
- **Ease of use**: Simple API for quick integration into projects.
|
| 12 |
+
|
| 13 |
+
For more details, visit the [official repository](https://github.com/cjhutto/vaderSentiment).
|
| 14 |
+
|
| 15 |
+
---
|
| 16 |
+
|
| 17 |
+
## Installation
|
| 18 |
+
|
| 19 |
+
To install the plugin, follow these steps:
|
| 20 |
+
|
| 21 |
+
1. Clone the repository:
|
| 22 |
+
```
|
| 23 |
+
git clone https://github.com/cjhutto/vaderSentiment.git
|
| 24 |
+
```
|
| 25 |
+
|
| 26 |
+
2. Navigate to the project directory:
|
| 27 |
+
```
|
| 28 |
+
cd vaderSentiment
|
| 29 |
+
```
|
| 30 |
+
|
| 31 |
+
3. Install the required dependencies:
|
| 32 |
+
```
|
| 33 |
+
pip install numpy requests
|
| 34 |
+
```
|
| 35 |
+
|
| 36 |
+
4. (Optional) Install the package using `setup.py`:
|
| 37 |
+
```
|
| 38 |
+
python setup.py install
|
| 39 |
+
```
|
| 40 |
+
|
| 41 |
+
---
|
| 42 |
+
|
| 43 |
+
## Usage
|
| 44 |
+
|
| 45 |
+
### Basic Usage
|
| 46 |
+
|
| 47 |
+
The primary functionality of the plugin is provided by the `SentimentIntensityAnalyzer` class. Below is an example of how to use it:
|
| 48 |
+
|
| 49 |
+
```python
|
| 50 |
+
from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer
|
| 51 |
+
|
| 52 |
+
analyzer = SentimentIntensityAnalyzer()
|
| 53 |
+
text = "VADER is amazing! 😍"
|
| 54 |
+
sentiment = analyzer.polarity_scores(text)
|
| 55 |
+
print(sentiment)
|
| 56 |
+
```
|
| 57 |
+
|
| 58 |
+
The output will include sentiment scores for:
|
| 59 |
+
- **Positive** (`pos`)
|
| 60 |
+
- **Neutral** (`neu`)
|
| 61 |
+
- **Negative** (`neg`)
|
| 62 |
+
- **Compound** (`compound`): Overall sentiment score.
|
| 63 |
+
|
| 64 |
+
### Advanced Usage
|
| 65 |
+
|
| 66 |
+
You can customize the sentiment analysis by modifying the lexicon or adding new rules. For example:
|
| 67 |
+
- Extend the lexicon with custom sentiment scores.
|
| 68 |
+
- Adjust sentiment weights for specific contexts.
|
| 69 |
+
|
| 70 |
+
Refer to the `vaderSentiment/vaderSentiment.py` file for detailed implementation and customization options.
|
| 71 |
+
|
| 72 |
+
---
|
| 73 |
+
|
| 74 |
+
## Tool Endpoints
|
| 75 |
+
|
| 76 |
+
The plugin provides the following key components:
|
| 77 |
+
|
| 78 |
+
### Classes
|
| 79 |
+
- **SentimentIntensityAnalyzer**: Core class for sentiment analysis.
|
| 80 |
+
|
| 81 |
+
### Functions
|
| 82 |
+
- **append_to_file**: Utility function for file operations (found in `additional_resources/build_emoji_lexicon.py`).
|
| 83 |
+
- **get_list_from_file**: Reads and processes data from files.
|
| 84 |
+
- **pad_ref**: Helper function for formatting data.
|
| 85 |
+
|
| 86 |
+
### Lexicon Files
|
| 87 |
+
- **vader_lexicon.txt**: Contains predefined sentiment scores for words and phrases.
|
| 88 |
+
- **emoji_utf8_lexicon.txt**: Sentiment scores for emojis.
|
| 89 |
+
|
| 90 |
+
---
|
| 91 |
+
|
| 92 |
+
## Notes and Troubleshooting
|
| 93 |
+
|
| 94 |
+
### Common Issues
|
| 95 |
+
1. **Missing Dependencies**: Ensure `numpy` and `requests` are installed.
|
| 96 |
+
```
|
| 97 |
+
pip install numpy requests
|
| 98 |
+
```
|
| 99 |
+
2. **File Encoding Errors**: If you encounter encoding issues, ensure your environment supports UTF-8.
|
| 100 |
+
|
| 101 |
+
### Tips
|
| 102 |
+
- For large-scale sentiment analysis, preprocess your data to remove unnecessary noise (e.g., HTML tags, special characters).
|
| 103 |
+
- Use the `emoji_utf8_lexicon.txt` file to enhance sentiment analysis for text containing emojis.
|
| 104 |
+
|
| 105 |
+
### Reporting Issues
|
| 106 |
+
If you encounter any problems, please report them on the [GitHub Issues page](https://github.com/cjhutto/vaderSentiment/issues).
|
| 107 |
+
|
| 108 |
+
---
|
| 109 |
+
|
| 110 |
+
## Development and Contribution
|
| 111 |
+
|
| 112 |
+
Contributions to the project are welcome! To contribute:
|
| 113 |
+
1. Fork the repository.
|
| 114 |
+
2. Create a new branch for your feature or bug fix.
|
| 115 |
+
3. Submit a pull request with a detailed description of your changes.
|
| 116 |
+
|
| 117 |
+
---
|
| 118 |
+
|
| 119 |
+
## License
|
| 120 |
+
|
| 121 |
+
This project is licensed under the MIT License. See the [LICENSE.txt](LICENSE.txt) file for details.
|
| 122 |
+
|
| 123 |
+
---
|
| 124 |
+
|
| 125 |
+
## Additional Resources
|
| 126 |
+
|
| 127 |
+
- **Emoji Lexicon Builder**: `additional_resources/build_emoji_lexicon.py` provides tools for extending the emoji lexicon.
|
| 128 |
+
- **Documentation**: Refer to the `README.md` and `vaderSentiment/vaderSentiment.py` for detailed explanations of the system.
|
| 129 |
+
|
| 130 |
+
---
|
| 131 |
+
|
| 132 |
+
## Acknowledgments
|
| 133 |
+
|
| 134 |
+
VADER was developed by C.J. Hutto and Eric Gilbert. It is widely used in research and industry for sentiment analysis tasks. For more information, visit the [official repository](https://github.com/cjhutto/vaderSentiment).
|
mcp_output/analysis.json
ADDED
|
@@ -0,0 +1,169 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"summary": {
|
| 3 |
+
"repository_url": "https://github.com/cjhutto/vaderSentiment",
|
| 4 |
+
"summary": "Imported via zip fallback, file count: 10",
|
| 5 |
+
"file_tree": {
|
| 6 |
+
"LICENSE.txt": {
|
| 7 |
+
"size": 1076
|
| 8 |
+
},
|
| 9 |
+
"__init__.py": {
|
| 10 |
+
"size": 0
|
| 11 |
+
},
|
| 12 |
+
"additional_resources/build_emoji_lexicon.py": {
|
| 13 |
+
"size": 1448
|
| 14 |
+
},
|
| 15 |
+
"additional_resources/emoji-test.txt": {
|
| 16 |
+
"size": 337881
|
| 17 |
+
},
|
| 18 |
+
"setup.cfg": {
|
| 19 |
+
"size": 1451
|
| 20 |
+
},
|
| 21 |
+
"setup.py": {
|
| 22 |
+
"size": 2119
|
| 23 |
+
},
|
| 24 |
+
"vaderSentiment/__init__.py": {
|
| 25 |
+
"size": 17
|
| 26 |
+
},
|
| 27 |
+
"vaderSentiment/emoji_utf8_lexicon.txt": {
|
| 28 |
+
"size": 94962
|
| 29 |
+
},
|
| 30 |
+
"vaderSentiment/vaderSentiment.py": {
|
| 31 |
+
"size": 33558
|
| 32 |
+
},
|
| 33 |
+
"vaderSentiment/vader_lexicon.txt": {
|
| 34 |
+
"size": 426784
|
| 35 |
+
}
|
| 36 |
+
},
|
| 37 |
+
"processed_by": "zip_fallback",
|
| 38 |
+
"success": true
|
| 39 |
+
},
|
| 40 |
+
"structure": {
|
| 41 |
+
"packages": [
|
| 42 |
+
"source",
|
| 43 |
+
"source.vaderSentiment"
|
| 44 |
+
]
|
| 45 |
+
},
|
| 46 |
+
"dependencies": {
|
| 47 |
+
"has_environment_yml": false,
|
| 48 |
+
"has_requirements_txt": false,
|
| 49 |
+
"pyproject": false,
|
| 50 |
+
"setup_cfg": true,
|
| 51 |
+
"setup_py": true
|
| 52 |
+
},
|
| 53 |
+
"entry_points": {
|
| 54 |
+
"imports": [],
|
| 55 |
+
"cli": [],
|
| 56 |
+
"modules": []
|
| 57 |
+
},
|
| 58 |
+
"llm_analysis": {
|
| 59 |
+
"core_modules": [
|
| 60 |
+
{
|
| 61 |
+
"package": "setup",
|
| 62 |
+
"module": "setup",
|
| 63 |
+
"functions": [
|
| 64 |
+
"read"
|
| 65 |
+
],
|
| 66 |
+
"classes": [],
|
| 67 |
+
"function_signatures": {
|
| 68 |
+
"read": []
|
| 69 |
+
},
|
| 70 |
+
"description": "Discovered via AST scan"
|
| 71 |
+
},
|
| 72 |
+
{
|
| 73 |
+
"package": "vaderSentiment",
|
| 74 |
+
"module": "vaderSentiment",
|
| 75 |
+
"functions": [
|
| 76 |
+
"allcap_differential",
|
| 77 |
+
"negated",
|
| 78 |
+
"normalize",
|
| 79 |
+
"scalar_inc_dec"
|
| 80 |
+
],
|
| 81 |
+
"classes": [
|
| 82 |
+
"SentiText",
|
| 83 |
+
"SentimentIntensityAnalyzer"
|
| 84 |
+
],
|
| 85 |
+
"function_signatures": {
|
| 86 |
+
"negated": [
|
| 87 |
+
"input_words",
|
| 88 |
+
"include_nt"
|
| 89 |
+
],
|
| 90 |
+
"normalize": [
|
| 91 |
+
"score",
|
| 92 |
+
"alpha"
|
| 93 |
+
],
|
| 94 |
+
"allcap_differential": [
|
| 95 |
+
"words"
|
| 96 |
+
],
|
| 97 |
+
"scalar_inc_dec": [
|
| 98 |
+
"word",
|
| 99 |
+
"valence",
|
| 100 |
+
"is_cap_diff"
|
| 101 |
+
]
|
| 102 |
+
},
|
| 103 |
+
"description": "Discovered via AST scan"
|
| 104 |
+
},
|
| 105 |
+
{
|
| 106 |
+
"package": "additional_resources",
|
| 107 |
+
"module": "build_emoji_lexicon",
|
| 108 |
+
"functions": [
|
| 109 |
+
"append_to_file",
|
| 110 |
+
"get_list_from_file",
|
| 111 |
+
"pad_ref",
|
| 112 |
+
"squeeze_whitespace"
|
| 113 |
+
],
|
| 114 |
+
"classes": [],
|
| 115 |
+
"function_signatures": {
|
| 116 |
+
"get_list_from_file": [
|
| 117 |
+
"file_name"
|
| 118 |
+
],
|
| 119 |
+
"append_to_file": [
|
| 120 |
+
"file_name",
|
| 121 |
+
"line_data"
|
| 122 |
+
],
|
| 123 |
+
"squeeze_whitespace": [
|
| 124 |
+
"text"
|
| 125 |
+
],
|
| 126 |
+
"pad_ref": [
|
| 127 |
+
"reference_code"
|
| 128 |
+
]
|
| 129 |
+
},
|
| 130 |
+
"description": "Discovered via AST scan"
|
| 131 |
+
}
|
| 132 |
+
],
|
| 133 |
+
"cli_commands": [],
|
| 134 |
+
"import_strategy": {
|
| 135 |
+
"primary": "import",
|
| 136 |
+
"fallback": "blackbox",
|
| 137 |
+
"confidence": 0.9
|
| 138 |
+
},
|
| 139 |
+
"dependencies": {
|
| 140 |
+
"required": [
|
| 141 |
+
"numpy",
|
| 142 |
+
"requests"
|
| 143 |
+
],
|
| 144 |
+
"optional": []
|
| 145 |
+
},
|
| 146 |
+
"risk_assessment": {
|
| 147 |
+
"import_feasibility": 0.8,
|
| 148 |
+
"intrusiveness_risk": "low",
|
| 149 |
+
"complexity": "simple"
|
| 150 |
+
}
|
| 151 |
+
},
|
| 152 |
+
"deepwiki_analysis": {
|
| 153 |
+
"repo_url": "https://github.com/cjhutto/vaderSentiment",
|
| 154 |
+
"repo_name": "vaderSentiment",
|
| 155 |
+
"content": "cjhutto/vaderSentiment\nVADER Sentiment Analysis Overview\nKey Features and Capabilities\nInstallation and Setup\nCore Components\nSentimentIntensityAnalyzer Class\nLexicon System\nEmoji Processing\nRule-Based Sentiment Adjustment\nUsage Guide\nBasic Usage Examples\nAdvanced Usage Patterns\nInterpreting Results\nPackage Architecture\nDevelopment and Contribution\nResearch Background\nVADER Sentiment Analysis Overview\nvaderSentiment/vaderSentiment.py\nVADER (Valence Aware Dictionary and sEntiment Reasoner) is a lexicon and rule-based sentiment analysis tool specifically designed for analyzing sentiments expressed in social media text. This document introduces the VADER system, explaining its purpose, core components, and key features.\nFor information about installation and setup, seeInstallation and Setup. For detailed usage examples, seeUsage Guide.",
|
| 156 |
+
"model": "gpt-4o",
|
| 157 |
+
"source": "selenium",
|
| 158 |
+
"success": true
|
| 159 |
+
},
|
| 160 |
+
"deepwiki_options": {
|
| 161 |
+
"enabled": true,
|
| 162 |
+
"model": "gpt-4o"
|
| 163 |
+
},
|
| 164 |
+
"risk": {
|
| 165 |
+
"import_feasibility": 0.8,
|
| 166 |
+
"intrusiveness_risk": "low",
|
| 167 |
+
"complexity": "simple"
|
| 168 |
+
}
|
| 169 |
+
}
|
mcp_output/env_info.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"environment": {
|
| 3 |
+
"type": "venv",
|
| 4 |
+
"name": "vaderSentiment_047938_venv",
|
| 5 |
+
"path": "/Users/yuanxujie/Downloads/Easy-Tool/Code2MCP-latest/workspace/vaderSentiment/vaderSentiment_047938_venv",
|
| 6 |
+
"files": {},
|
| 7 |
+
"python": "3.10",
|
| 8 |
+
"exec_prefix": [
|
| 9 |
+
"/Users/yuanxujie/Downloads/Easy-Tool/Code2MCP-latest/workspace/vaderSentiment/vaderSentiment_047938_venv/bin/python"
|
| 10 |
+
]
|
| 11 |
+
},
|
| 12 |
+
"original_tests": {
|
| 13 |
+
"passed": false,
|
| 14 |
+
"report_path": null
|
| 15 |
+
},
|
| 16 |
+
"timestamp": 1762048023.487503,
|
| 17 |
+
"conda_available": true
|
| 18 |
+
}
|
mcp_output/mcp_logs/llm_statistics.json
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"total_calls": 3,
|
| 3 |
+
"failed_calls": 0,
|
| 4 |
+
"retry_count": 0,
|
| 5 |
+
"total_prompt_tokens": 2887,
|
| 6 |
+
"total_completion_tokens": 2829,
|
| 7 |
+
"total_tokens": 5716,
|
| 8 |
+
"average_prompt_tokens": 962.3333333333334,
|
| 9 |
+
"average_completion_tokens": 943.0,
|
| 10 |
+
"average_tokens": 1905.3333333333333
|
| 11 |
+
}
|
mcp_output/mcp_logs/run_log.json
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"timestamp": 1762048046.324425,
|
| 3 |
+
"node": "RunNode",
|
| 4 |
+
"test_result": {
|
| 5 |
+
"passed": false,
|
| 6 |
+
"report_path": null,
|
| 7 |
+
"stdout": "",
|
| 8 |
+
"stderr": "usage: mcp_import_min.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]\n or: mcp_import_min.py --help [cmd1 cmd2 ...]\n or: mcp_import_min.py --help-commands\n or: mcp_import_min.py cmd --help\n\nerror: no commands supplied\n"
|
| 9 |
+
},
|
| 10 |
+
"run_result": {
|
| 11 |
+
"success": false,
|
| 12 |
+
"test_passed": false,
|
| 13 |
+
"exit_code": 1,
|
| 14 |
+
"stdout": "",
|
| 15 |
+
"stderr": "usage: mcp_import_min.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]\n or: mcp_import_min.py --help [cmd1 cmd2 ...]\n or: mcp_import_min.py --help-commands\n or: mcp_import_min.py cmd --help\n\nerror: no commands supplied\n",
|
| 16 |
+
"timestamp": 1762048046.32439,
|
| 17 |
+
"error_type": "RuntimeError",
|
| 18 |
+
"error": "Runtime error: usage: mcp_import_min.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]\n or: mcp_import_min.py --help [cmd1 cmd2 ...]\n or: mcp_import_min.py --help-commands\n or: mcp_import_min.py cmd --help\n\nerror: no commands supplied\n",
|
| 19 |
+
"details": {
|
| 20 |
+
"command": "/Users/yuanxujie/Downloads/Easy-Tool/Code2MCP-latest/workspace/vaderSentiment/vaderSentiment_047938_venv/bin/python /Users/yuanxujie/Downloads/Easy-Tool/Code2MCP-latest/workspace/vaderSentiment/mcp_output/start_mcp.py",
|
| 21 |
+
"working_directory": "/Users/yuanxujie/Downloads/Easy-Tool/Code2MCP-latest/workspace/vaderSentiment",
|
| 22 |
+
"environment_type": "venv"
|
| 23 |
+
}
|
| 24 |
+
},
|
| 25 |
+
"environment": {
|
| 26 |
+
"type": "venv",
|
| 27 |
+
"name": "vaderSentiment_047938_venv",
|
| 28 |
+
"path": "/Users/yuanxujie/Downloads/Easy-Tool/Code2MCP-latest/workspace/vaderSentiment/vaderSentiment_047938_venv",
|
| 29 |
+
"files": {},
|
| 30 |
+
"python": "3.10",
|
| 31 |
+
"exec_prefix": [
|
| 32 |
+
"/Users/yuanxujie/Downloads/Easy-Tool/Code2MCP-latest/workspace/vaderSentiment/vaderSentiment_047938_venv/bin/python"
|
| 33 |
+
]
|
| 34 |
+
},
|
| 35 |
+
"plugin_info": {
|
| 36 |
+
"files": {
|
| 37 |
+
"mcp_output/start_mcp.py": "/Users/yuanxujie/Downloads/Easy-Tool/Code2MCP-latest/workspace/vaderSentiment/mcp_output/start_mcp.py",
|
| 38 |
+
"mcp_output/mcp_plugin/__init__.py": "/Users/yuanxujie/Downloads/Easy-Tool/Code2MCP-latest/workspace/vaderSentiment/mcp_output/mcp_plugin/__init__.py",
|
| 39 |
+
"mcp_output/mcp_plugin/mcp_service.py": "/Users/yuanxujie/Downloads/Easy-Tool/Code2MCP-latest/workspace/vaderSentiment/mcp_output/mcp_plugin/mcp_service.py",
|
| 40 |
+
"mcp_output/mcp_plugin/adapter.py": "/Users/yuanxujie/Downloads/Easy-Tool/Code2MCP-latest/workspace/vaderSentiment/mcp_output/mcp_plugin/adapter.py",
|
| 41 |
+
"mcp_output/mcp_plugin/main.py": "/Users/yuanxujie/Downloads/Easy-Tool/Code2MCP-latest/workspace/vaderSentiment/mcp_output/mcp_plugin/main.py",
|
| 42 |
+
"mcp_output/requirements.txt": "/Users/yuanxujie/Downloads/Easy-Tool/Code2MCP-latest/workspace/vaderSentiment/mcp_output/requirements.txt",
|
| 43 |
+
"mcp_output/README_MCP.md": "/Users/yuanxujie/Downloads/Easy-Tool/Code2MCP-latest/workspace/vaderSentiment/mcp_output/README_MCP.md"
|
| 44 |
+
},
|
| 45 |
+
"adapter_mode": "import",
|
| 46 |
+
"endpoints": [
|
| 47 |
+
"read",
|
| 48 |
+
"allcap_differential",
|
| 49 |
+
"negated",
|
| 50 |
+
"normalize",
|
| 51 |
+
"scalar_inc_dec",
|
| 52 |
+
"sentitext",
|
| 53 |
+
"sentimentintensityanalyzer",
|
| 54 |
+
"append_to_file",
|
| 55 |
+
"get_list_from_file",
|
| 56 |
+
"pad_ref",
|
| 57 |
+
"squeeze_whitespace"
|
| 58 |
+
],
|
| 59 |
+
"mcp_dir": "/Users/yuanxujie/Downloads/Easy-Tool/Code2MCP-latest/workspace/vaderSentiment/mcp_output/mcp_plugin",
|
| 60 |
+
"tests_dir": "/Users/yuanxujie/Downloads/Easy-Tool/Code2MCP-latest/workspace/vaderSentiment/mcp_output/tests_mcp",
|
| 61 |
+
"main_entry": "start_mcp.py",
|
| 62 |
+
"readme_path": "/Users/yuanxujie/Downloads/Easy-Tool/Code2MCP-latest/workspace/vaderSentiment/mcp_output/README_MCP.md",
|
| 63 |
+
"requirements": [
|
| 64 |
+
"fastmcp>=0.1.0",
|
| 65 |
+
"pydantic>=2.0.0"
|
| 66 |
+
]
|
| 67 |
+
},
|
| 68 |
+
"fastmcp_installed": false
|
| 69 |
+
}
|
mcp_output/mcp_plugin/__init__.py
ADDED
|
File without changes
|
mcp_output/mcp_plugin/__pycache__/mcp_service.cpython-311.pyc
ADDED
|
Binary file (3.94 kB). View file
|
|
|
mcp_output/mcp_plugin/adapter.py
ADDED
|
@@ -0,0 +1,145 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
import sys
|
| 3 |
+
|
| 4 |
+
# Path settings
|
| 5 |
+
source_path = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))), "source")
|
| 6 |
+
sys.path.insert(0, source_path)
|
| 7 |
+
|
| 8 |
+
# Import statements
|
| 9 |
+
from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer
|
| 10 |
+
from additional_resources.build_emoji_lexicon import append_to_file, get_list_from_file, pad_ref
|
| 11 |
+
|
| 12 |
+
class Adapter:
|
| 13 |
+
"""
|
| 14 |
+
Adapter class for MCP plugin integration with the VADER Sentiment Analysis tool.
|
| 15 |
+
Provides methods to utilize identified classes and functions from the analysis result.
|
| 16 |
+
"""
|
| 17 |
+
|
| 18 |
+
def __init__(self):
|
| 19 |
+
"""
|
| 20 |
+
Initializes the Adapter class with default mode and checks for import feasibility.
|
| 21 |
+
"""
|
| 22 |
+
self.mode = "import"
|
| 23 |
+
self.status = {"status": "success", "message": "Adapter initialized successfully."}
|
| 24 |
+
try:
|
| 25 |
+
self.analyzer = SentimentIntensityAnalyzer()
|
| 26 |
+
except ImportError as e:
|
| 27 |
+
self.mode = "fallback"
|
| 28 |
+
self.status = {"status": "error", "message": f"Failed to import SentimentIntensityAnalyzer: {str(e)}"}
|
| 29 |
+
|
| 30 |
+
# -------------------------------------------------------------------------
|
| 31 |
+
# SentimentIntensityAnalyzer Methods
|
| 32 |
+
# -------------------------------------------------------------------------
|
| 33 |
+
|
| 34 |
+
def analyze_sentiment(self, text):
|
| 35 |
+
"""
|
| 36 |
+
Analyzes the sentiment of the given text using SentimentIntensityAnalyzer.
|
| 37 |
+
|
| 38 |
+
Parameters:
|
| 39 |
+
text (str): The text to analyze.
|
| 40 |
+
|
| 41 |
+
Returns:
|
| 42 |
+
dict: A dictionary containing sentiment scores or error status.
|
| 43 |
+
"""
|
| 44 |
+
try:
|
| 45 |
+
if self.mode == "fallback":
|
| 46 |
+
return {"status": "error", "message": "Sentiment analysis unavailable in fallback mode."}
|
| 47 |
+
sentiment_scores = self.analyzer.polarity_scores(text)
|
| 48 |
+
return {"status": "success", "data": sentiment_scores}
|
| 49 |
+
except Exception as e:
|
| 50 |
+
return {"status": "error", "message": f"Error analyzing sentiment: {str(e)}"}
|
| 51 |
+
|
| 52 |
+
# -------------------------------------------------------------------------
|
| 53 |
+
# Build Emoji Lexicon Methods
|
| 54 |
+
# -------------------------------------------------------------------------
|
| 55 |
+
|
| 56 |
+
def append_to_file(self, file_path, content):
|
| 57 |
+
"""
|
| 58 |
+
Appends content to a file using the append_to_file function.
|
| 59 |
+
|
| 60 |
+
Parameters:
|
| 61 |
+
file_path (str): Path to the file.
|
| 62 |
+
content (str): Content to append.
|
| 63 |
+
|
| 64 |
+
Returns:
|
| 65 |
+
dict: A dictionary indicating success or error status.
|
| 66 |
+
"""
|
| 67 |
+
try:
|
| 68 |
+
append_to_file(file_path, content)
|
| 69 |
+
return {"status": "success", "message": f"Content appended to {file_path} successfully."}
|
| 70 |
+
except Exception as e:
|
| 71 |
+
return {"status": "error", "message": f"Error appending to file: {str(e)}"}
|
| 72 |
+
|
| 73 |
+
def get_list_from_file(self, file_path):
|
| 74 |
+
"""
|
| 75 |
+
Retrieves a list of items from a file using the get_list_from_file function.
|
| 76 |
+
|
| 77 |
+
Parameters:
|
| 78 |
+
file_path (str): Path to the file.
|
| 79 |
+
|
| 80 |
+
Returns:
|
| 81 |
+
dict: A dictionary containing the list of items or error status.
|
| 82 |
+
"""
|
| 83 |
+
try:
|
| 84 |
+
data = get_list_from_file(file_path)
|
| 85 |
+
return {"status": "success", "data": data}
|
| 86 |
+
except Exception as e:
|
| 87 |
+
return {"status": "error", "message": f"Error retrieving list from file: {str(e)}"}
|
| 88 |
+
|
| 89 |
+
def pad_reference(self, reference, padding):
|
| 90 |
+
"""
|
| 91 |
+
Pads a reference string using the pad_ref function.
|
| 92 |
+
|
| 93 |
+
Parameters:
|
| 94 |
+
reference (str): The reference string to pad.
|
| 95 |
+
padding (int): The padding value.
|
| 96 |
+
|
| 97 |
+
Returns:
|
| 98 |
+
dict: A dictionary containing the padded reference or error status.
|
| 99 |
+
"""
|
| 100 |
+
try:
|
| 101 |
+
padded_ref = pad_ref(reference, padding)
|
| 102 |
+
return {"status": "success", "data": padded_ref}
|
| 103 |
+
except Exception as e:
|
| 104 |
+
return {"status": "error", "message": f"Error padding reference: {str(e)}"}
|
| 105 |
+
|
| 106 |
+
# -------------------------------------------------------------------------
|
| 107 |
+
# Fallback Handling
|
| 108 |
+
# -------------------------------------------------------------------------
|
| 109 |
+
|
| 110 |
+
def fallback_message(self):
|
| 111 |
+
"""
|
| 112 |
+
Provides a fallback message when the primary import mode fails.
|
| 113 |
+
|
| 114 |
+
Returns:
|
| 115 |
+
dict: A dictionary containing the fallback message.
|
| 116 |
+
"""
|
| 117 |
+
if self.mode == "fallback":
|
| 118 |
+
return {"status": "error", "message": "Primary import mode failed. Operating in fallback mode."}
|
| 119 |
+
return {"status": "success", "message": "Primary import mode is active."}
|
| 120 |
+
|
| 121 |
+
# -------------------------------------------------------------------------
|
| 122 |
+
# Utility Methods
|
| 123 |
+
# -------------------------------------------------------------------------
|
| 124 |
+
|
| 125 |
+
def check_status(self):
|
| 126 |
+
"""
|
| 127 |
+
Checks the current status of the adapter.
|
| 128 |
+
|
| 129 |
+
Returns:
|
| 130 |
+
dict: A dictionary containing the adapter's status.
|
| 131 |
+
"""
|
| 132 |
+
return self.status
|
| 133 |
+
|
| 134 |
+
def reset_adapter(self):
|
| 135 |
+
"""
|
| 136 |
+
Resets the adapter to its initial state.
|
| 137 |
+
|
| 138 |
+
Returns:
|
| 139 |
+
dict: A dictionary indicating the reset status.
|
| 140 |
+
"""
|
| 141 |
+
try:
|
| 142 |
+
self.__init__()
|
| 143 |
+
return {"status": "success", "message": "Adapter reset successfully."}
|
| 144 |
+
except Exception as e:
|
| 145 |
+
return {"status": "error", "message": f"Error resetting adapter: {str(e)}"}
|
mcp_output/mcp_plugin/main.py
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
MCP Service Auto-Wrapper - Auto-generated
|
| 3 |
+
"""
|
| 4 |
+
from mcp_service import create_app
|
| 5 |
+
|
| 6 |
+
def main():
|
| 7 |
+
"""Main entry point"""
|
| 8 |
+
app = create_app()
|
| 9 |
+
return app
|
| 10 |
+
|
| 11 |
+
if __name__ == "__main__":
|
| 12 |
+
app = main()
|
| 13 |
+
app.run()
|
mcp_output/mcp_plugin/mcp_service.py
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
import sys
|
| 3 |
+
|
| 4 |
+
source_path = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))), "source")
|
| 5 |
+
if source_path not in sys.path:
|
| 6 |
+
sys.path.insert(0, source_path)
|
| 7 |
+
|
| 8 |
+
from fastmcp import FastMCP
|
| 9 |
+
from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer
|
| 10 |
+
|
| 11 |
+
mcp = FastMCP("vaderSentiment_service")
|
| 12 |
+
|
| 13 |
+
# Initialize the sentiment analyzer
|
| 14 |
+
analyzer = SentimentIntensityAnalyzer()
|
| 15 |
+
|
| 16 |
+
@mcp.tool(name="analyze_sentiment", description="Analyze sentiment of text using VADER. Returns sentiment scores (positive, negative, neutral, compound)")
|
| 17 |
+
def analyze_sentiment(text: str):
|
| 18 |
+
"""
|
| 19 |
+
Analyze the sentiment of the given text.
|
| 20 |
+
|
| 21 |
+
Args:
|
| 22 |
+
text: The text to analyze
|
| 23 |
+
|
| 24 |
+
Returns:
|
| 25 |
+
Dictionary with sentiment scores: neg, neu, pos, compound
|
| 26 |
+
- neg: negative sentiment score (0 to 1)
|
| 27 |
+
- neu: neutral sentiment score (0 to 1)
|
| 28 |
+
- pos: positive sentiment score (0 to 1)
|
| 29 |
+
- compound: overall sentiment score (-1 to 1, normalized)
|
| 30 |
+
"""
|
| 31 |
+
try:
|
| 32 |
+
scores = analyzer.polarity_scores(text)
|
| 33 |
+
return {"success": True, "result": scores, "error": None}
|
| 34 |
+
except Exception as e:
|
| 35 |
+
return {"success": False, "result": None, "error": str(e)}
|
| 36 |
+
|
| 37 |
+
@mcp.tool(name="get_word_valence", description="Get the sentiment valence score for a specific word from VADER lexicon")
|
| 38 |
+
def get_word_valence(word: str):
|
| 39 |
+
"""
|
| 40 |
+
Look up the sentiment valence of a word in the VADER lexicon.
|
| 41 |
+
|
| 42 |
+
Args:
|
| 43 |
+
word: The word to look up (case-insensitive)
|
| 44 |
+
|
| 45 |
+
Returns:
|
| 46 |
+
Dictionary with the word's valence score or None if not found
|
| 47 |
+
"""
|
| 48 |
+
try:
|
| 49 |
+
word_lower = word.lower()
|
| 50 |
+
if word_lower in analyzer.lexicon:
|
| 51 |
+
valence = analyzer.lexicon[word_lower]
|
| 52 |
+
return {"success": True, "result": {"word": word, "valence": valence}, "error": None}
|
| 53 |
+
else:
|
| 54 |
+
return {"success": True, "result": None, "error": f"Word '{word}' not found in VADER lexicon"}
|
| 55 |
+
except Exception as e:
|
| 56 |
+
return {"success": False, "result": None, "error": str(e)}
|
| 57 |
+
|
| 58 |
+
@mcp.tool(name="get_emoji_description", description="Get the textual description of an emoji from VADER emoji lexicon")
|
| 59 |
+
def get_emoji_description(emoji: str):
|
| 60 |
+
"""
|
| 61 |
+
Look up the textual description of an emoji.
|
| 62 |
+
|
| 63 |
+
Args:
|
| 64 |
+
emoji: The emoji character to look up
|
| 65 |
+
|
| 66 |
+
Returns:
|
| 67 |
+
Dictionary with the emoji's description or None if not found
|
| 68 |
+
"""
|
| 69 |
+
try:
|
| 70 |
+
if emoji in analyzer.emojis:
|
| 71 |
+
description = analyzer.emojis[emoji]
|
| 72 |
+
return {"success": True, "result": {"emoji": emoji, "description": description}, "error": None}
|
| 73 |
+
else:
|
| 74 |
+
return {"success": True, "result": None, "error": f"Emoji '{emoji}' not found in VADER emoji lexicon"}
|
| 75 |
+
except Exception as e:
|
| 76 |
+
return {"success": False, "result": None, "error": str(e)}
|
| 77 |
+
|
| 78 |
+
|
| 79 |
+
|
| 80 |
+
def create_app():
|
| 81 |
+
"""Create and return FastMCP application instance"""
|
| 82 |
+
return mcp
|
| 83 |
+
|
| 84 |
+
if __name__ == "__main__":
|
| 85 |
+
mcp.run(transport="http", host="0.0.0.0", port=8000)
|
mcp_output/requirements.txt
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
fastmcp>=0.1.0
|
| 2 |
+
pydantic>=2.0.0
|
| 3 |
+
numpy
|
| 4 |
+
requests
|
| 5 |
+
vaderSentiment>=3.3.0
|
mcp_output/start_mcp.py
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
"""
|
| 3 |
+
MCP Service Startup Entry
|
| 4 |
+
"""
|
| 5 |
+
import sys
|
| 6 |
+
import os
|
| 7 |
+
|
| 8 |
+
project_root = os.path.dirname(os.path.abspath(__file__))
|
| 9 |
+
mcp_plugin_dir = os.path.join(project_root, "mcp_plugin")
|
| 10 |
+
if mcp_plugin_dir not in sys.path:
|
| 11 |
+
sys.path.insert(0, mcp_plugin_dir)
|
| 12 |
+
|
| 13 |
+
from mcp_service import create_app
|
| 14 |
+
|
| 15 |
+
def main():
|
| 16 |
+
"""Start FastMCP service"""
|
| 17 |
+
app = create_app()
|
| 18 |
+
# Use environment variable to configure port, default 8000
|
| 19 |
+
port = int(os.environ.get("MCP_PORT", "8000"))
|
| 20 |
+
|
| 21 |
+
# Choose transport mode based on environment variable
|
| 22 |
+
transport = os.environ.get("MCP_TRANSPORT", "stdio")
|
| 23 |
+
if transport == "http":
|
| 24 |
+
app.run(transport="http", host="0.0.0.0", port=port)
|
| 25 |
+
else:
|
| 26 |
+
# Default to STDIO mode
|
| 27 |
+
app.run()
|
| 28 |
+
|
| 29 |
+
if __name__ == "__main__":
|
| 30 |
+
main()
|
mcp_output/tests_smoke/mcp_import_min.py
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
import sys, os
|
| 3 |
+
sys.path.insert(0, r'/Users/yuanxujie/Downloads/Easy-Tool/Code2MCP-latest/workspace/vaderSentiment/mcp_output/mcp_plugin')
|
| 4 |
+
from mcp_service import create_app
|
| 5 |
+
app = create_app()
|
| 6 |
+
print('OK')
|