Repository avatar
Search & Data Extraction
v1.3.0
active

freesound-mcp

io.github.MuShan-bit/freesound-mcp

Search, inspect, and download Freesound sounds via MCP.

Documentation

Freesound MCP

Search, inspect, and download Creative Commons sounds from Freesound inside any MCP-compatible AI client.

English | 简体中文

CI status npm version npm downloads MIT license Node.js 20 or newer LobeHub MCP version LobeHub MCP score Glama MCP rating


A Model Context Protocol server that lets AI applications search, inspect, discover similar sounds, and download audio from Freesound using natural language.

Freesound-MCP speaks MCP over stdio, keeps no database, and runs as a single Node.js process. It is designed for Claude Desktop, Cursor, VS Code, and any other MCP-compatible host.

Contents

Overview

  • 🔍 Search by keywords with pagination, sorting, duration ranges, license, tags/excluded tags, file type, category, uploader, channel count, sample rate, rating, download count, geotags, and AudioCommons acoustic descriptors (BPM, tonality, loop, single-event).
  • 🎵 Inspect & Analyze full sound metadata (including parsed packId, preview URLs, and waveform/spectrogram images) plus AudioCommons acoustic analysis (tempo, key, loudness, dynamics, timbre) without downloading.
  • 📦 Browse Packs & Creators to explore matching sounds from the same pack or discover a creator's curated packs.
  • 🔗 Discover similar sounds using Freesound's acoustic and semantic similarity spaces, with relevance scores.
  • ⬇️ Download & Batch Download MP3/OGG previews or original uploads (with OAuth2), conflict handling (overwrite/skip/rename), bounded concurrency, and automatic CREDITS.md + freesound-manifest.json attribution files.
  • 📎 Resources and prompts for license guidance, search syntax, live sound/pack templates, attribution, and layered sound-design workflows.
  • 🛡️ Resilient & Cached requests with timeouts, exponential backoff, Retry-After support, and a lightweight in-memory TTL/LRU read cache.

Tools

ToolDescriptionRead-only
freesound_searchSearch sounds with metadata, technical, and acoustic filtersYes
freesound_similarFind sounds similar to a reference soundYes
freesound_get_soundGet detailed metadata for one sound (including packId)Yes
freesound_get_packGet sound pack metadata and paginated sounds inside the packYes
freesound_get_analysisGet AudioCommons tempo, key, loudness, loop, and timbre metricsYes
freesound_get_userGet a creator's public profile and curated sound packsYes
freesound_downloadDownload a preview (MP3/OGG) or original file to diskNo
freesound_batch_downloadConcurrently download up to 25 sounds and generate CREDITS.mdNo
freesound_generate_creditsGenerate or refresh CREDITS.md and freesound-manifest.jsonNo

freesound_search

ParameterTypeDefaultDescription
querystring— (required)Keywords; pass an empty string to browse all sounds
pageinteger1Page number
pageSizeinteger15Results per page, 1-150
sortstringscorescore, duration_asc, duration_desc, created_asc, created_desc, downloads_asc, downloads_desc, rating_asc, or rating_desc
minDurationnumber—Minimum duration in seconds
maxDurationnumber—Maximum duration in seconds
licensestring—Creative Commons 0, Attribution, or Attribution NonCommercial; values with spaces are quoted automatically
tagsstring[]—Tags that every result must contain (AND)
excludeTagsstring[]—Tags to exclude from results (NOT)
typestring—wav, aif, aiff, ogg, mp3, m4a, or flac
categorystring—Broad Sound Taxonomy category, for example Instrument samples
usernamestring—Uploader username
groupByPackbooleanfalseReturn at most one sound per pack
channelsinteger—Exact channel count (1-8, e.g. 1 for mono, 2 for stereo)
minSamplerateinteger—Minimum sample rate in Hz (e.g. 44100, 48000)
minRatingnumber—Minimum average rating (0-5)
minDownloadsinteger—Minimum download count
minTemponumber—Minimum AudioCommons tempo in BPM (ac_tempo)
maxTemponumber—Maximum AudioCommons tempo in BPM (ac_tempo)
tonalitystring—AudioCommons tonality filter (ac_tonality), e.g. C major
loopboolean—Filter for seamless loops (ac_loop)
singleEventboolean—Filter for single audio events / one-shots (ac_single_event)
isGeotaggedboolean—Filter for sounds with/without geographic coordinates
rawFilterstring—Raw Freesound Solr filter expression appended to structured filters

Returns count, page, pageSize, totalPages, and results. Each result contains id, name, duration, license, preview, and, when available, username, tags, type, channels, samplerate, filesize, downloads, rating, and score.

{
  "count": 128,
  "page": 1,
  "pageSize": 15,
  "totalPages": 9,
  "results": [
    {
      "id": 123456,
      "name": "Rain on a tin roof",
      "duration": 12.4,
      "license": "Creative Commons 0",
      "preview": "https://cdn.freesound.org/previews/...",
      "username": "fieldrecordist",
      "tags": ["rain", "ambience"],
      "type": "wav",
      "samplerate": 48000,
      "downloads": 421,
      "rating": 4.6
    }
  ]
}

freesound_similar

ParameterTypeDefaultDescription
soundIdinteger— (required)Reference Freesound sound ID
pageinteger1Page number
pageSizeinteger15Results per page, 1-150
similaritySpacestringAPI defaultlaion_clap (semantic + acoustic) or freesound_classic (low-level acoustic features)

Returns the same paginated structure as freesound_search, including a relevance score for every result.

freesound_get_sound

ParameterTypeDescription
soundIdintegerFreesound sound ID (required)

Returns id, name, description, tags, license, username, and duration, plus optional type, channels, samplerate, filesize, bitrate, bitdepth, created, url, downloadUrl, previewHqMp3, previewLqMp3, previewHqOgg, previewLqOgg, waveformUrl, spectrogramUrl, downloads, rating, numRatings, numComments, category, subcategory, pack, packId, and genAiPreference.

downloadUrl points at the original file endpoint and requires OAuth2.

freesound_get_pack

ParameterTypeDefaultDescription
packIdinteger— (required)Freesound pack ID
includeSoundsbooleantrueInclude paginated sounds belonging to the pack
pageinteger1Page number for pack sounds
pageSizeinteger15Pack sounds per page, 1-150

freesound_get_analysis

ParameterTypeDescription
soundIdintegerFreesound sound ID (required)

Returns AudioCommons acoustic metrics (available, tempo, tempoConfidence, tonality, tonalityConfidence, noteName, noteMidi, noteFrequency, noteConfidence, loudness, dynamicRange, loop, singleEvent, brightness, warmth, hardness, depth, roughness, boominess, sharpness, reverb) without downloading the audio file.

freesound_get_user

ParameterTypeDefaultDescription
usernamestring— (required)Freesound uploader username
includePacksbooleantrueInclude paginated packs created by the user
pageinteger1Page number for user packs
pageSizeinteger15User packs per page, 1-150

freesound_download

ParameterTypeDefaultDescription
soundIdinteger— (required)Freesound sound ID
qualitystringlqhq/lq for previews, or original for the uploaded file
previewFormatstringmp3Preferred preview format: mp3 or ogg
filenamestringgeneratedOutput filename; unsafe characters are stripped and the extension is enforced
downloadDirstring~/.freesound-mcp/downloadsTarget directory; supports ~
conflictStrategystringoverwriteExisting file behavior: overwrite, skip, or rename
writeAttributionbooleanfalseUpdate CREDITS.md and freesound-manifest.json in downloadDir

Returns filePath, soundId, name, quality, format, bytes, duration, license, sourceUrl, plus optional username, pageUrl, skipped, creditsPath, and manifestPath.

freesound_batch_download

ParameterTypeDefaultDescription
soundIdsinteger[]— (required)1-25 Freesound sound IDs (duplicates are ignored)
qualitystringlqhq/lq for previews, or original (requires OAuth2)
previewFormatstringmp3Preferred preview format: mp3 or ogg
downloadDirstring~/.freesound-mcp/downloadsTarget directory
conflictStrategystringoverwriteExisting file behavior: overwrite, skip, or rename
concurrencyinteger3Maximum concurrent downloads (1-5)
writeAttributionbooleantrueGenerate/update CREDITS.md and freesound-manifest.json

freesound_generate_credits

ParameterTypeDefaultDescription
soundIdsinteger[]—Optional sound IDs (up to 25) to look up and include
downloadDirstring—Directory containing freesound-manifest.json and/or target output folder
writeFilesbooleantrue when downloadDir is setWrite CREDITS.md and freesound-manifest.json to disk

Notes:

  • Preview downloads do not require OAuth2 and are MP3/OGG transcodes, not the original upload.
  • quality: "original" requires FREESOUND_OAUTH_TOKEN and downloads the file as uploaded.
  • Files are streamed to a temporary file and atomically renamed, so an interrupted download never leaves a partial file under the final name.

Resources

MCP resources provide reference material and live metadata that clients can attach as context.

URIDescription
freesound://guides/licensingCreative Commons license table, attribution template, and checklist
freesound://guides/searchKeyword syntax, filters, sorting, pagination, and follow-up tools
freesound://sounds/{soundId}Detailed JSON metadata for one sound (resource template)
freesound://packs/{packId}Detailed JSON metadata and first page of sounds for a pack (resource template)

Prompts

Prompt templates guide the model through common Freesound workflows.

PromptArgumentsDescription
freesound_search_planbrief, optional maxDuration, licensePlan and execute a filtered search
freesound_license_attributionsoundName, author, license, optional sourceUrlGenerate attribution text and license obligations
freesound_sound_design_palettescene, optional mood, maxDurationBuild a layered ambience/foley/accent palette

Requirements

  • Node.js 20 or newer
  • npm 9 or newer (or pnpm/yarn)
  • A Freesound API key from the Freesound API documentation
  • Optional: a Freesound OAuth2 access token for original-quality downloads

Installation

From npm

npx -y @mushan_bit/freesound-mcp

The server speaks MCP over stdio, so it is normally launched by your MCP client rather than run by hand.

From source

git clone https://github.com/MuShan-bit/freesound-mcp.git
cd freesound-mcp
npm ci
npm run build

Directory listings

Configuration

Environment variables

VariableRequiredDefaultDescription
FREESOUND_API_KEYYes—API token used for search and metadata requests
FREESOUND_OAUTH_TOKENNo—OAuth2 access token for quality: "original" downloads
FREESOUND_DOWNLOAD_DIRNo~/.freesound-mcp/downloadsDefault download directory
FREESOUND_TIMEOUT_MSNo20000Per-request timeout in milliseconds
FREESOUND_MAX_RETRIESNo2Retries for 429/5xx, timeouts, and network errors (0-5)
FREESOUND_RETRY_BASE_MSNo500Base delay for exponential backoff
FREESOUND_CACHE_TTL_MSNo60000In-memory TTL for read-only JSON GET cache (0 disables caching)
FREESOUND_CACHE_MAX_ENTRIESNo200Maximum entries kept in the in-memory LRU cache
FREESOUND_API_BASE_URLNohttps://freesound.org/apiv2API base URL override (testing or proxy)

Requests that receive 429 Too Many Requests honour the Retry-After header (up to 10 seconds) before retrying. Other retryable failures use exponential backoff with jitter.

Claude Desktop

Add this to claude_desktop_config.json:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "freesound": {
      "command": "npx",
      "args": ["-y", "@mushan_bit/freesound-mcp"],
      "env": {
        "FREESOUND_API_KEY": "your_freesound_api_key"
      }
    }
  }
}

To run a local build instead:

{
  "mcpServers": {
    "freesound": {
      "command": "node",
      "args": ["/absolute/path/to/freesound-mcp/build/index.js"],
      "env": {
        "FREESOUND_API_KEY": "your_freesound_api_key",
        "FREESOUND_OAUTH_TOKEN": "optional_oauth2_token"
      }
    }
  }
}

Restart the client after editing the configuration.

Cursor

Add the same mcpServers object to ~/.cursor/mcp.json (global) or .cursor/mcp.json (project).

VS Code

Add the server to .vscode/mcp.json:

{
  "servers": {
    "freesound": {
      "command": "npx",
      "args": ["-y", "@mushan_bit/freesound-mcp"],
      "env": {
        "FREESOUND_API_KEY": "your_freesound_api_key"
      }
    }
  }
}

Usage

Ask your AI client in natural language:

  • "Find me a stereo CC0 drum loop between 115 and 125 BPM with at least 48 kHz sample rate."
  • "Inspect sound #123456, check its AudioCommons tempo and loudness, and list the rest of its pack."
  • "Show me the profile and sound packs created by fieldrecordist."
  • "Find sounds similar to #123456."
  • "Batch download sounds #101, #102, and #103 as HQ OGG previews into ./assets/sfx and generate CREDITS.md."
  • "Download the original file for #123456." (requires OAuth2)

The model calls the tools above and reports the license and author returned by Freesound.

Security and licensing

  • Keep FREESOUND_API_KEY and FREESOUND_OAUTH_TOKEN secret. Pass them through your MCP client's env block, never through source control.
  • Freesound content is licensed under Creative Commons terms. Check the license field before use, credit the author, and respect Attribution NonCommercial restrictions.
  • freesound_download writes to the local filesystem. Choose a writable downloadDir and avoid running the server with elevated privileges.
  • Filenames supplied by callers are sanitized, and downloads are written to a temporary file before being renamed into place.

Troubleshooting

SymptomFix
401 UnauthorizedCheck FREESOUND_API_KEY and restart the client
429 Too Many RequestsLower request frequency or increase FREESOUND_MAX_RETRIES; Freesound enforces API quotas
FREESOUND_OAUTH_TOKEN is not setSet an OAuth2 token to use quality: "original"
"does not expose a downloadable preview"The sound has no previews; try another sound or original download
Download fails with EACCES/ENOENTChoose a writable downloadDir
Server missing from the clientRun npm run build, use an absolute path, and check the client's MCP logs

Development

npm ci
npm run build       # compile TypeScript to build/
npm run typecheck   # type-check without emitting
npm test            # build + run the node:test suite
npm start           # run the compiled stdio server

The test suite uses Node's built-in test runner and mocks fetch, so it runs offline without a Freesound API key. The runner collects *.test.js files explicitly, so npm test also works on Node.js 20 and Windows shells. CI runs the same commands on Node.js 20, 22, and 24.

Project layout:

  • src/index.ts — stdio entry point and shutdown handling
  • src/server.ts — MCP tool registration, schemas, and error mapping
  • src/freesound/client.ts — authenticated HTTP client, timeouts, retries, and TTL/LRU cache
  • src/freesound/search.ts — search parameters, technical/acoustic filters, and result mapping
  • src/freesound/similar.ts — similar-sounds endpoint
  • src/freesound/sounds.ts — sound details, single/batch downloads, and credit generation
  • src/freesound/packs.ts — pack metadata and pack sound listings
  • src/freesound/analysis.ts — AudioCommons acoustic analysis mapping
  • src/freesound/users.ts — creator profile and user pack listings
  • src/freesound/credits.ts — CREDITS.md rendering and freesound-manifest.json persistence
  • src/freesound/errors.ts — structured error types
  • src/resources.ts — MCP resources and sound/pack metadata templates
  • src/prompts.ts — MCP prompt templates
  • scripts/check-version.mjs — release metadata version consistency check
  • scripts/extract-release-notes.mjs — changelog section extractor for GitHub Releases
  • server.json — official MCP Registry metadata
  • lhm.plugin.json — LobeHub MCP Marketplace metadata
  • test/ — unit tests, in-memory MCP tests, and a real stdio end-to-end test

Contributing

Contributions are welcome! Please open an issue first for major changes, then submit a pull request. Keep the test suite green and update the README and CHANGELOG for user-visible changes.

License

This project is licensed under the MIT License — see LICENSE for details.

Acknowledgments

NPM
@mushan_bit/freesound-mcp
Install Command
npm install @mushan_bit/freesound-mcp